Sophisticated Models {RandomFields}R Documentation

Sophicated Covariance And Variogram Models

Description

Covariance returns the values of complex stationary and nonstationary covariance functions; see CovarianceFct for basic isotropic models

Details

Here only the non-isotropic and hyper models are listed; see CovarianceFct for basic isotropic models.

The implemented models are in standard notation for a covariance function (variance 1, nugget 0, scale 1) and for positive real arguments h (and t) for the stationary models or parts:

See CovarianceFct for comments on the use of a covariance model.

However, for the above sophicated models, the following differences should be considered:

To use the above models, a new, very flexible, straight forward list notation is needed. Background of this notation is that we have ‘primitives’, i.e. functions that are positive definite. And we have ‘operators’, i.e. functionals that make out of given variograms, covariance functions etc. new models. Examples are "+", "*", or Gneiting's "nsst". Consequently, we need also an operator, called "$", that changes the variance and the scale.

E.g. a standard exponential model (variance=1, scale=1, nugget=0) is now simply written as

list("exponential")

(And no param must be given!)

Further, a standard exponential model with a nugget effect, nugget variance 3, is now written as

list("+",
list("exponential"),
list("$", var=3, list("nugget"))
)

Here, only the relevant parameters need to be given; the missing parameters get standard values whenever standard values exist, e.g. variance equals 1 if not given. Further, the parameters can (and must) be called by names, which makes complex models much more readable. Submodels, as list("exponential") in the second example above, can (but need not) be called by name.

Value

CovarianceFct and Covariance return a vector of values of the covariance function.

Author(s)

Martin Schlather, martin.schlather@math.uni-goettingen.de http://www.stochastik.math.uni-goettingen.de/~schlather

References

Overviews:

ave1, ave2

biWM, parsbiWM

coxisham

curlfree

cutoff

delayeffect

divfree

Iaco-Cesare model

vector

Ma-Stein model

ma1/ma2

mixed

nonstWM/hyperbolic/cauchy

nsst

Quasi-arithmetic means (qam, mqam)

Paciorek-Stein (steinst1)

Stein

stp

tbm

See Also

CovarianceFct, EmpiricalVariogram, GetPracticalRange, parameter.range, RandomFields, RFparameters, ShowModels.

Examples



PrintModelList(op=TRUE)

## the subsequent model can be used to model rainfall...
y <- x <- seq(0, 10, len=25) # better 256 -- but will take a while 
T <- c(0, 10, 1) # better 0.1
col <- c(topo.colors(300)[1:100], cm.colors(300)[c((1:50) * 2, 101:150)])

model <- list("coxisham", mu=c(1, 1), D=matrix(nr=2, c(1, 0.5, 0.5, 1)),
              list("whittle", nu=1)
              )

system.time(z <- GaussRF(x, y, T=T, grid =TRUE, spectral.lines=1500,
                       model = model))

zlim <- range(z)
time <- dim(z)[3]
for (i in 1:time) {
  Print(i)
  sleep.milli(100)
  image(x, y, z[, , i], add=i>1, col=col, zlim=zlim)
}


####################################################
####################################################

 # the following five model definitions are the same!
 ## (1) very traditional form
 (cv <- CovarianceFct(x, model="bessel", param=c(NA, 2 , 1, 5, 0.5)))

 ## (2) traditional form in list notation
 model <- list(model="bessel", param=c(NA, 2, 1, 5, 0.5))
 cv - CovarianceFct(x, model=model)

 ## (3) nested model definition
 cv - CovarianceFct(x, model="bessel",
                    param=rbind(c(2, 5, 0.5), c(1, 0, 0)))

 #### most general notation in form of lists
 ## (4) isotropic notation 
 model <- list("+",
               list("$", var=2, scale=5, list("bessel", 0.5)),
               list("nugget"))
 cv - CovarianceFct(x, model=model)
              
 ## (5) anisotropic notation
 model <- list("+",
               list("$", var=2, aniso=0.2, list("bessel", 0.5)),
               list("nugget"))
 cv - CovarianceFct(as.matrix(x), model=model)




####################################################
####################################################

 # The model gneitingdiff was defined in RandomFields v1.0.
 # This isotropic covariance function is valid for dimensions less
 # than or equal to 3 and has two positive parameters.
 # It is a class of models with compact support that allows for
 # smooth parametrisation of the differentiability up to order 6.     
 # The former model `gneitingdiff' should now be coded as

 gneitingdiff <- function(p){
    list("+",
         list("$", var=p[3], list("nugget")),
         list("$", scale=p[4],
              list("*", 
                   list("$", var=p[2], scale=p[6], list("gneiting")),
                   list("whittle", nu=p[5])
                  )
              )
         )
 }

 # and then 
 param <- c(NA, runif(5, max=10)) 
 CovarianceFct(0:100, model=gneitingdiff(param))
 ## instead of formerly CovarianceFct(x,"gneitingdiff",param)

[Package RandomFields version 2.0.54 Index]