Last chance! 50% off unlimited learning
Sale ends in
Covariance
returns the values of complex stationary and
nonstationary covariance functions;
see CovarianceFct
and Covariance
return a vector of values of the covariance function.+
Operator that adds up at most 10 submodels*
Operator that multiplies at most 10 submodels$
var
) and the
coordinates or distances byscale
) oranisoT
multiplied from the
right orproj
on a lower dimensional space along
the coordinate axisscale
is positive,aniso
andA
are matrices, andproj
is a vector indices with between 1 and
the dimension of$x$.
Note, at most one of the parameters,anisoT
,A
,proj
may be given at the same time. The operator$
has 1 submodel.
If the dimension of the field is 1 oraniso
is not given, the
operator allows for derivatives.
ave1
% bernoulli 2010 paper example 13whittle
model, seeave2
(nonstationary)
Here$C(h) = C_0(h, 0)$where$C_0$is theave1
model.biWM
(bivariate model)
whittle
model and$i,j=1,2$.
For (i=j) the constants$\nu_{ii}, s_{ii}, c_{ii} > 0$.
For the offdiagonal elements with have$C_{12} = C_{21}$,$s_{12}=s_{21} > 0$,$\nu_{12} =\nu_{21} = 0.5 (\nu_{11} + \nu{22}) /
\nu_{red}$for some constant$\nu_{red} \in (0,1]$.
The scalar$c_{12} =c_{21} = \rho_{red} \sqrt{f m c_{11} c_{22}}$where The model now has the parametersnu
$= (nu_{11}, nu_{22})$
nured12
$=\nu_{red}$
s
$= (s_{11}, s_{22})$
s12
$= s_{12} = s_{21}$\c
$= (c_{11}, c_{22})$
rhored
$=\rho_{red}$See alsoparsbiWM
.
constant
This model is designes for the use inX
in modelcoxisham
curlfree
(multivariate) See also the modelsdivfree
andvector
.
cutoff
NOTE: The algorithm that checks the given parameters knows
only about some few necessary conditions.
Hence it is not ensured that
the cutoff-model is a valid covariance function for any
choice of phi and the parameters.
For certain models$\phi$, i.e.stable
,whittle
andgencauchy
, some sufficient conditions
are known.
delayeffect
(bivariate)divfree
(multivariate) See also the modelscurlfree
andvector
.
EtAxxA
(auxiliary function)Exp
%%%%%%%%%%%%%%%%%%%%%%%%%%%
M
ma1
ma2
mastein
Note, that for numerical reasons,$\nu+\gamma+d$may not exceed the value 80.0. If exceeded the algorithm fails.
mixed
This model is designed for the use inX
is a matrix of independent variables.
The second,b
, is a vector of regression coefficients.
Furthermore a submodel,covb
, may give the covariance structure
forb
. Letn
the number of (non-repeated) observations.
The following combinations are allowed:
X
is given. ThenX
is a scalar
or a vector of lengthn
, andX
defines a known mean.X
andb
are given. ThenX
is a$(n \times m)$matrix
where$m$is the length of the vector$b$. Then a fixed
effect is defined.X
andcovb
are given.covb
is the modelconstant,
then we have a random model (maybe with preceeding model$
).covb
is any other model then we have
a geoadditive partNA
s, but notX
.mqam
(multivariate quasi-arithmetic mean)stable
,gauss
,exponential
,$\phi$is given
by the name of the corresponding covariance function$C$,
i.e.$phi( . ) = C(sqrt( . ))$. Warning:RandomFields
cannot check whether the combination
of$\phi$and$C_i$is valid.
natsc
s
is chosen bynatsc
such that the practical range
(or the mathematical range, if finite) is 1.nonstWM
nu
.
If$\nu$is a function, use the submodelNu
.
Note that forNu
the usual list structure applies
and only the defined covriance models can be used.nsst
(Non-Separable Space-Time model)nugget
(multivariat model)parsbiWM
(bivariate model)
whittle
model and$i,j=1,2$.
For (i=j) the constants$\nu_{ii}, c_{ii} \ge 0$and$s>0$.
For the offdiagonal elements with have$C_{12} = C_{21}$.
Furthermore,$\nu_{12} =\nu_{21} = 0.5 (\nu_{11} + \nu{22})$and the scalar$c_{12} =c_{21} = \rho_{red} \sqrt{f m c_{11} c_{22}}$where The model now has the parametersnu
$= (\nu_{11}, \nu_{22})$
s
$= (s_{11}, s_{22})$
s12
$= s_{12} = s_{21}$
c
$= (c_{11}, c_{22})$
rhored
$=\rho_{red}$See alsobiWM
.
Pow
qam
(Quasi-arithmetic mean)stable
,gauss
,exponential
,$\phi$is given
by the name of the corresponding covariance function$C$,
i.e.$phi( . ) = C(sqrt( . ))$. Warning:RandomFields
cannot check whether the combination
of$\phi$and$C_i$is valid.
rational
(auxiliary)Rotat
(auxiliary function)Stein
NOTE: The algorithm that checks the given parameters knows
only about some few necessary conditions.
Hence it is not ensured that
the Stein-model is a valid covariance function for any
choice of phi and the parameters.
For certain models$\phi$, i.e.stable
,whittle
,gencauchy
, and the variogram
modelfractalB
some sufficient conditions are known.
steinst1
(non-separabel space time model)stp
tbm2
This operator is currently only designed for internal use!
tbm3
n=1
reduced to the standard TBM operatorn
should be an integer.
This operator is currently only designed for internal use!vector
(multivariate) See also the modelsdivfree
andcurlfree
()$PracticalRange
is usually not defined for the above modelsmodel="name"
andparam=c(mean, variance, nugget, scale,...)
."+"
, "*"
, 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
(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.
CovarianceFct
ave1, ave2
biWM, parsbiWM
coxisham
curlfree
delayeffect
divfree
vector
Ma-Stein model
mixed
nsst
Quasi-arithmetic means (qam, mqam)
Stein
tbm
RandomFields
,
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)
Run the code above in your browser using DataLab