CovarianceFct
returns the values of a covariance function;
see Variogram
returns the values of a variogram modelCovariance(x, y=NULL, model, param=NULL, dim=ifelse(is.matrix(x),ncol(x),1),
Distances, fctcall=c("Cov", "Variogram", "CovMatrix"))
CovarianceFct(...)
CovMatrix(...)Variogram(x, model, param, dim=ifelse(is.matrix(x),ncol(x),1))
dim=1
then x
is a vector.model
is one of the names given in the
Details.param
is the vector
param=c(mean,variance,nugget,scale,...)
, in this order;
The dots ...
stand for additional parameters of the
model, e.g. the smoothing parameter in the whittle
x
themselvesCovarianceFct
is identical to the function
Covariance
.CovarianceFct
returns a vector of values of the covariance
function.
Variogram
returns a vector of values of the variogram model. CovMatrix
return a covariance matrix. Here a matrix of
of coordinates (x
) or a vector or a matrix of Distances
is expected.
CovMatrix
allows also for variogram models. Then negative of
variogram matrix is returned.
+
see `sophisticated'*
see `sophisticated'$
see `sophisticated'ave1
see `sophisticated'ave2
see `sophisticated'bessel
$$C(h)=2^\nu \Gamma(\nu+1)h^{-\nu} J_\nu(h)$$The parameter$\nu$is greater than or equal to$\frac{d-2}2$, where$d$is the
dimension of the random field.fractalB
wave
cauchy (normal scale mixture)
$$C(h)=\left(1+h^2\right)^{-\beta}$$The parameter$\beta$is positive.
The model possesses two generalisations, thegencauchy
model and thehyperbolic
model.
See alsononstatcauchy
incauchytbm
$$C(h)= (1+(1-\beta/\gamma)h^\alpha)(1+h^\alpha)^(-\beta/\alpha-1)$$The parameter$\alpha$is in (0,2] and$\beta$is positive.
The model is valid for dimensions$d\le\gamma$;
this has been shown for integer$\gamma$, but the
package allows real values of$\gamma$.
It allows for simulating random fields where
fractal dimension and Hurst coefficient can be chosen
independently.
It has negative correlations for$\beta>\gamma$and large$h$. This model is equivalent to the modellist("tbm3", n=gamma, list("gencauchy", alpha=alpha,
beta=beta))
circular
$$C(h)=
\left(1-\frac 2\pi
\left(h \sqrt{1-h^2} +
\arcsin(h)\right)\right)
1_{[0,1]}(h)$$This isotropic covariance function is valid only for dimensions
less than or equal to 2.cone
This model is used only for methods based on marked point processes
(seecoxisham
seesophisticated.cutoff
seesophisticated.cubic
$$C(h)=(1- 7h^2+8.75h^3-3.5h^5+0.75 h^7)1_{[0,1]}(h)$$This model is valid only for dimensions less than or equal to 3.
It is a 2 times differentiable covariance functions with compact
support. %(See Chiles&Delfiner, 1998)dagum
$$C(h) = 1-(1 + h^{-\beta})^{-\gamma/\beta}$$RandomFields allows to vary the parameters$\beta$and$\gamma$within the intervals$(0,1]$and$(0,1)$, respectively.dampedcosine
(hole effect model)$$C(h)= e^{-\lambda h} \cos(h), \quad h\ge0$$This model is valid
for dimension 1 iff$\lambda \ge 1$,
for dimension 2 iff$\lambda \ge 1$,
and for dimension 3 iff$\lambda \ge \sqrt{3}$.DeWijsian
$$\gamma(h) = \log(\|h\|^\alpha + 1)$$generalised version of the DeWijsian model with$\alpha \in (0,2]$EAxxA
and see `sophisticated'EtAxxA
and see `sophisticated'exponential (normal scale mixture)
$$C(h)=e^{-h}, \quad h\ge0$$This model is a special case of thewhittle
model
(for$\nu=\frac12$there)
and thestable
class (for$\alpha = 1$).FD
$$C(k) = \frac{(-1)^k \Gamma(1-a/2)^2}{\Gamma(1-a/2+k)
\Gamma(1-a/2-k),
\qquad k \in {\bf N}}$$and linearly interpolated otherwise.
Here,$\Gamma$is the Gamma function and$a \in [-1, 1)$.
The model is defined in 1 dimension only.
Remark: the fractionally differenced process
stems from time series modelling
where the grid locations are multiples
of the scale parameter.fractalB
(fractal Brownian motion)$$gamma(h) = h^\alpha$$Here,$\alpha \in (0,2]$.
(Implemented for up to three dimensions). See alsogenB
.fractgauss
$$C(h) = 0.5 (|h+1|^{\alpha} - 2|h|^{\alpha} +
|h-1|^{\alpha})$$This model is the covariance function for the fractional Gaussian noise
with Hurst parameter$H=\alpha /2$,$\alpha \in (0,2]$.
In particular, the model is valid only
in one dimension.gauss (normal scale mixture)
$$C(h)=e^{-h^2}$$This model is a special case of thestable
class
(for$\kappa=2$there).
Note that the corresponding function for the random coins
method (cf. the methods based on marked point processes ingneiting
for an alternative model that does not have
the disadvantages of the Gaussian model.genB
(generalised fractal Brownian motion)$$\gamma(h) = (h^{\alpha}+1)^{\delta} -1$$Here,$\alpha \in(0,2]$and$\delta \in (0,1)$.
(Implemented for up to three dimensions). See alsofractalB
.gencauchy
(generalisedcauchy
; normal scale mixture)
$$C(h)=
\left(1+h^\alpha\right)^(-\beta/\alpha)$$The parameter$\alpha$is in (0,2], and$\beta$is positive.
This model allows for simulating random fields where
fractal dimension and Hurst coefficient can be chosen
independently.gengneiting
(generalisedgneiting
)
If$n=1$then$$C(h)=\left(1+(\alpha+1)h\right) * (1-h)^{\alpha+1}
1_{[0,1]}(h)$$If$n=2$then$$C(h)=\left(1+(\alpha+2)h+\left((\alpha+2)^2-1\right)h^2/3\right)
(1-h)^{\alpha+2} 1_{[0,1]}(h)$$If$n=3$then$$C(h)=\left(1+(\alpha+3)h+\left(2(\alpha+3)^2-3\right)h^2/5
+\left((\alpha+3)^2-4\right)(\alpha+3)h^3/15\right)(1-h)^{\alpha+3}
1_{[0,1]}(h)$$The parameter$n$is a positive integer; here only the
cases$n=1, 2, 3$are implemented.
The parameter$\alpha$is greater than or equal to$(d + 2n +1)/2$where$d$is the
dimension of the random field.% the differentiability is ??
gneiting
$$C(h)=\left(1 + 8 sh + 25 (sh)^2 + 32
(sh)^3\right)(1-sh)^8 1_{[0,1]}(sh)$$where$s=0.301187465825$.
This isotropic covariance function is valid only for dimensions less
than or equal to 3.
It is a 6 times differentiable covariance functions with compact
support.
It is an alternative to thegaussian
model since
its graph is visually hardly distinguishable from the graph of
the Gaussian model, but possesses neither the mathematical and nor the
numerical disadvantages of the Gaussian model.
This model is a special case ofgengneiting
(for$n=3$and$\alpha=5$there).
Note that, in the original work by Gneiting (1999),$s=\frac{10\sqrt2}{47}\approx 0.3008965$, a numerical value slightly deviating from the
optimal one.gneitingdiff
.$$C(h)=( 1 + 8 h \alpha^{-1}
+ 25 h^2\alpha^{-2}
+ 32 h^3 \alpha^{-3} )
( 1-h \alpha^{-1} )^8
2^{1-\nu} (\Gamma(\nu))^{-1}
h^{\nu} K_{\nu}(h) 1_{[0,\alpha]}(h)$$This isotropic covariance function is valid only for dimensions less
than or equal to 3.
The parameters$\nu$and$\alpha$are
positive.
This class of models with compact support
allows for smooth parametrisation of the differentiability up to
order 6.hyperbolic (normal scale mixture)
$$C(h)= \delta^{-\lambda}
(K_{\lambda}(\nu \delta))^{-1}
( \delta^2 + h^2 )^{\lambda/2}
K_{\lambda}(
\nu [ \delta^2 + h^2 ]^{1/2} )$$The parameters are such that
$\delta\ge0$,$\nu>0$and$\lambda>0,\quad$or
$\delta>0$,$\nu>0$and$\lambda=0,\quad$or
$\delta>0$,$\nu\ge0$, and$\lambda<0$. note="" that="" this="" class="" is="" over-parametrised;="" always="" one="" of="" the="" three="" parameters$\nu$,$\delta$,="" and="" scale="" can="" be="" eliminated="" in="" formula.="" therefore,="" these="" parameters="" should="" kept="" fixed="" any="" simulation="" study.="" model="" contains="" as="" special="" cases="" thewhittlemodel and thecauchy
model, for$\delta=0$and$\nu=0$, respectively. See alsononstathyperbolic
inCovariance.
0$.>
iacocesare
(non-separabel space time model)$$C(h, t)=(1+\|h\|^\nu+|t|^\lambda)^{-\delta}$$The parameters$\nu$and$\lambda$take values
in$[1,2]$; the parameters$\delta$must be greater
than or equal to half the space-time dimension.bessel
whittle
andmatern
power
(a=1
there).lgd1
(local-global distinguisher)$$C(h)=
1-\frac\beta{\alpha+\beta}|h|^{\alpha}, |h|\le 1 \qquad \hbox{and} \qquad
\frac\alpha{\alpha+\beta}|h|^{-\beta}, |h|> 1$$Here$\beta>0$and$\alpha$is in$(0,(3 - d)/2]$for dimension$d=1,2$.
The random field has fractal dimension$d + 1 - \alpha/2$and Hurst coefficient$1 -\beta/2$for$\beta \in (0,1]$% \item \code{matern}\cr
% equals \eqn{W_\nu(\sqrt{2\nu}x)} where \eqn{W_\nu} is the In contrast to thewhittle
model
this model separates the effects of the scaling parameter and the
shape parameter. For$\nu=0.5$we get the exponential
model; for$\nu=\infty$we get$C(x) = \exp(0.5 x^2)$.
The model$C(x \sqrt{2})$equals the Handcock-Wallis (1994)
parameterisation.
The model allows further to replace$nu$by$1/\nu$,
setting the second parameterinvnu=TRUE
.
See alsowhittle
, andnonstatwhittle
in
M
and see `sophisticated'mastein
see `sophisticated'mixed
see `sophisticated'nugget
$$C(h)=1_{{0}}(h)$$If the model is used inparam
-definition mode,
eitherparam[2]
, thevariance
,
orparam[3]
, thenugget
, must be zero.
If the model is used in the list-definition mode,
the anisotropy matrix must be given in an anisotropic
context, but not
the scale parameter in an isotropic context.
See alsopenta
$$C(x)= \left(1 - \frac{22}3 x^2 +33 x^4 -
\frac{77}2 x^5 + \frac{33}2
x^7 -\frac{11}2 x^9 + \frac 56 x^{11}
\right)1_{[0,1]}(x)$$valid only for dimensions less than or equal to 3.
This is a 4 times differentiable covariance functions with compact
support.
%(See Chiles&Delfiner, 1998)power
$$C(x)= (1-x)^a 1_{[0,1]}(x)$$This covariance function is valid for dimension$d$if$a \ge (d+1)/2$.
For$\kappa=1$we get the well-known triangle (or tent)
model, which is valid on the real line, only.
% proposition 3.8 in phd thesis tilmann gneiting
% Golubov, Zastavnyistable
.qexponential
$$C(x)= ( 2 e^{-x} - \alpha e^{-2x} ) / ( 2 - \alpha )$$The parameter$\alpha$takes values in$[0,1]$.
% \item rational quadratic model\cr
% See \code{cauchy} for \eqn{\kappa=1}{a=1}.
% (Cressie)rational
and see `sophisticated'spherical
$$C(x)=\left(1- 1.5 x+0.5 x^3\right)
1_{[0,1]}(x)$$%{C(x)=
% 1 - 1.5 x + 0.5 x^3 if 0<=x<=1, 0="" otherwise}="" this="" isotropic="" covariance="" function="" is="" valid="" only="" for="" dimensions="" less="" than="" or="" equal="" to="" 3.<="" li="">stable
$$C(x)=\exp\left(-x^\alpha\right)$$The parameter$\alpha$is in$(0,2]$.
Seeexponential
andgaussian
for special cases.Stein
and see `sophisticated'steinst1
and see `sophisticated'stable
.tbm2
and see `sophisticated'tbm3
and see `sophisticated'power
.power
.wave
$$C(x)=\frac{\sin x}x, \quad x>0 \qquad \hbox{and } C(0)=1$$This isotropic covariance function is valid only for dimensions less
than or equal to 3.
It is a special case of thebessel
model
(for$\kappa$$=0.5$).whittle (normal scale mixture)
$$C(x)=W_\nu(x) = 2^{1-\nu} \Gamma(\nu)^{-1} x^\nu
K_\nu(x)$$The parameter$\nu$is positive.
This is the model of choice if the smoothness of a random field is to
be parametrised: if$\nu > m$then the
graph is$m$times differentiable. The model is a special case of thehyperbolic
model (for$\nu_3=0$there).
See alsononstWM
insophisticated.
param
,
param=c(mean, variance, nugget, scale, ...)
.
Here whittle
model.
In case a model has several parameters, as in hyperbolic
,
the parameters must be given in the sequence they are explained
aboved. However, it is strongly recommended to use the list
notation explained in sophisticated
. The list
definition available in ()$PracticalRange
. If the latter isTRUE
and the covariance model is isotropic
then the covariance function is internally
rescaled such that cov$(1)\approx 0.05$for standard
parameters (scale=1
).CovarianceFct
andVariogram
isdim=1
.Cauchy models, generalisations and extensions
Dagum model
Generalised fractal Brownian motion
Hyperbolic model
lgd
RandomFields
,
PrintModelList()
x <- 0:100
## 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)))
plot(x, cv)
## (2) above model in the very general list definition
model <- list("+",
list("$", var=2, scale=5, list("bessel", 0.5)),
list("nugget"))
cv <- CovarianceFct(x, model=model)
points(x, cv, col="red", pch=20) ## no differnce to first
## (3) nested model definition
## this kind of definiton models is depreciated from Version 2.0 on
cv <- CovarianceFct(x, model="bessel",
param=rbind(c(2, 5, 0.5), c(1, 0, 0)))
points(x, cv, col="blue", pch=20, cex=0.5)
## (4) anisotropic notation
model <- list("+",
list("$", var=2, aniso=as.matrix(0.2),
list("bessel", nu=0.5)
),
list("nugget")
)
cv <- CovarianceFct(as.matrix(x), model=model)
points(x, cv, col="green", pch=4)
## Depreciated list defintions in Version 1.x
## this way of defining a model still works, but
## is not supported anymore
## (isotropic version)
model <- list(list(model="bessel", var=2, kappa=0.5, scale=5),
"+",
list(model="nugget", var=1, scale=1))
cv <- CovarianceFct(x, model=model)
points(x, cv, col="black", pch=5)
Run the code above in your browser using DataCamp Workspace