RFsimulate {geostatsp} | R Documentation |
This function simulates conditional and unconditional Gaussian random fields, calling the function in the RandomFields package of the same name.
## S4 method for signature 'ANY,Raster' RFsimulate(model, x, data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'numeric,SpatialGrid' RFsimulate(model, x,data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'numeric,SpatialPixels' RFsimulate(model, x, data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'numeric,SpatialPoints' RFsimulate(model, x, data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'numeric,GridTopology' RFsimulate(model, x, data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'RMmodel,GridTopology' RFsimulate(model, x, data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'RMmodel,SpatialPoints' RFsimulate(model, x, data=NULL, err.model=NULL, n = 1, ...) ## S4 method for signature 'matrix,Raster' RFsimulate(model, x, data=NULL, err.model=NULL, n = nrow(model), ...) ## S4 method for signature 'matrix,Spatial' RFsimulate(model, x, data=NULL, err.model=NULL, n = nrow(model), ...) ## S4 method for signature 'data.frame,ANY' RFsimulate(model, x, data=NULL, err.model=NULL, n = nrow(model), ...) modelRandomFields(param, includeNugget=FALSE)
model |
object of class |
x |
Object of type |
data |
For conditional simulation and random imputing only.
If |
err.model |
For conditional simulation and random imputing only. |
n |
number of realizations to generate. |
... |
for advanced use:
further options and control parameters for the simulation
that are passed to and processed by |
param |
A vector of named parameters |
includeNugget |
If |
If model
is a matrix, a different set of parameters is used for each simulation. If
data
has the same number of columns as model
has rows,
a different column i
is used with parameters in row i
.
An object of the same class as x
, with the exception of x
being a GridTopology
where a Raster is returned.
Patrick E. Brown patrick.brown@utoronto.ca
RFsimulate
,
RFfit
,
RFgetModelInfo
,
RFgui
,
RMmodel
,
RFoptions
,
RFsimulateAdvanced
,
RFsimulate.more.examples
library('geostatsp') model <- c(var=5, range=1,shape=0.5) myraster = raster(nrows=20,ncols=30,xmn=0,ymn=0,xmx=6,ymx=4, crs=CRS("+proj=utm +zone=17 +datum=NAD27 +units=m +no_defs")) set.seed(0) simu <- RFsimulate(model, x=myraster, n=3) plot(simu[['sim2']]) # conditional simulation firstSample = RFsimulate( model, x=SpatialPoints(myraster)[seq(1,ncell(myraster), len=100), ], n=3 ) secondSample = RFsimulate( model = cbind(var=5:3, range=1:3, shape=seq(0.5, 1.5, len=3)), x= myraster, data=firstSample,n=4 ) plot(secondSample) # convert the model to RandomFields format and plot if(requireNamespace('RandomFields', quietly=TRUE)) { RandomFields::plot(modelRandomFields(model)) }