ShowModels {RandomFields}R Documentation

Interactive Choice of Models and Parameters

Description

ShowModels is an interactive plot of models and one- or two-dimensional simulations; it allows for fitting variogram models by eye.

Usage

ShowModels(covx=ifelse(is.null(empirical),4,max(empirical$c)),
           x=NULL, y=NULL, fixed.rs=FALSE, method=NULL, empirical=NULL,
           model=NULL, param=NULL, all.param=NULL, PracticalRange=FALSE, 
           legend=TRUE, register=0,...)

Arguments

covx if a sinlge value is given, it is the largest distance for which the covariance functions or the variograms are plotted; otherwise the models are plotted for the given values, and the origin.
x if NULL simulations are not performed; otherwise it gives the x coordinates of a grid.
y if NULL at most one-dimensional simulations are performed (depending on the value of x); otherwise y gives the y coordinates of a two-dimensional grid.
fixed.rs if TRUE then the same random seed is used for all simulations.
method simulation method, see RFMethods; if NULL then a suitable simulation method is chosen automatically.
empirical empirical variogram; a list as returned by EmpiricalVariogram.
model string; covariance model, see CovarianceFct, or type PrintModelList() to get all options. If given this model is shown at the beginning.
param parameter vector: param=c(mean, variance, nugget, scale,...); the parameters must be given in this order; see CovarianceFct for more details. Only considered if model is given. If given model is initialized by param.
all.param all.param=c(mean, variance, nugget, scale); the parameters must be given in this order; If all.param is given then the parameters of all covariance functions are set to the given values. The values are overwritten for a specific model if model and param are given. Note that it is not possible to set the values of additional parameters of a parametrised class by means of all.param.
PracticalRange logical. If TRUE the range of the covariance functions C(h) is adjusted so that the covariance function is about 0.05 for scale==1 and distance h=1.
legend if TRUE then a legend is added to the two-dimensional plot; note that legend has a bug up to R-1.2.3.
register register where intermediate results of the simulations are stored, see also GaussRF.
... additional graphics options for the plot of the one- or two-dimensional simulations, see plot and image.

Details

The interactive plot consists of 4 parts:

The interactive plot is left by clicking any mouse button different from the left when the top right part is active.

Value

list of the last model and its parameters.

Author(s)

Martin Schlather, Martin.Schlather@uni-bayreuth.de http://www.geo.uni-bayreuth.de/~martin

See Also

CovarianceFct, GaussRF, RFMethods, RandomFields.

Examples

# first example: one-dimensional simulations
close.screen(close.screen())
RFparameters(Print=1)
x <-  seq(1,10,0.1);
ShowModels(x=x)

# second example: two-dimensional simulations and
#                 empirical variogram
close.screen(close.screen())
RFparameters(Print=1)
dx <- runif(300,0,8)
dy <- runif(300,0,8)
dz <- GaussRF(x=dx, y=dy, grid=FALSE, model="gaus",
      param=c(1,2,1,2))
ev <- EmpiricalVariogram(x=dx, y=dy, data=dz, grid=FALSE,
      bin=(-1:20)/4)
x <-  seq(1,5,0.1);
ShowModels(x=x,y=x,empirical=ev)

[Package Contents]