RandomFields
offers various tools for
Changings lists some further changings, in particular of argument and argument names.
plot(model)
.spConform=TRUE
.
This is the default.
IfspConform=FALSE
,
simple objects as in version 2 are returned.
These simple objects are frequently provided with an S3 class.
This options makes the returning procedure much faster, but
currently does not allow for the comfortable use ofRFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
# simulate some data first (Gaussian random field with exponential
# covariance; 6 realisations)
model <- RMexp()
x <- seq(0, 10, if (interactive()) 0.1 else 1)
z <- RFsimulate(model, x, x, n=6)
## select some data from the simulated data
xy <- as.matrix(expand.grid(x=x, y=x))
pts <- sample(nrow(xy), 100)
data <- matrix(ncol=6, as.vector(z))[pts, ]
data <- cbind(xy[pts, ], data)
plot(z, data)
## re-estimate the parameter (true values are 1)
estmodel <- RMexp(var=NA, scale=NA)
(fit <- RFfit(estmodel, data=data))
## show a kriged field based on the estimated parameters
kriged <- RFinterpolate(fit, x, x, data=data)
plot(kriged, data)
FinalizeExample()
Run the code above in your browser using DataLab