# Sophisticated Models

0th

Percentile

##### Sophicated Covariance And Variogram Models

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

Keywords
spatial
##### 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:

• + Operator that adds up at most 10 submodels
• * Operator that multiplies at most 10 submodels
• $ $$C(x, y) = v C(x / s, y / s)$$$$C(x, y) = v C(x a, y a)$$$$C(x, y) = v C(A x, A y)$$$$C(x, y) = v C(p x, p y)$$Operator that modifies the the variance ($v=$var) and the coordinates or distances by • the scale ($s=$scale) or • the anisotropy matrix$a=$anisoTmultiplied from the right or • the anisotropy matrix$A$multiplied from the left or •$p=$projon a lower dimensional space along the coordinate axis The parameterscaleis positive,anisoandAare matrices, andprojis a vector indices with between 1 and the dimension of$x$. Note, at most one of the parameters,anisoT,A,projmay be given at the same time. The operator$has 1 submodel. If the dimension of the field is 1 oranisois not given, the operator allows for derivatives.

• ave1% bernoulli 2010 paper example 13$$C(h, u) = |E + 2Ahh^tA|^{-1/2} \phi(\sqrt(\|h\|^2/ 2 + (z^th + u)^2 (1 - 2h^tA (E+2Ahh^tA)^{-1} Ah)))$$where$E$is the identity matrix.$A$is a symmetric positive definite$(d-1) \times (d-1)$and$z$is a$d-1$dimensional vector. The function$\phi$is normal mixture model, e.g.whittlemodel, seeCovarianceFctandPrintModelList().
• ave2(nonstationary) Here$C(h) = C_0(h, 0)$where$C_0$is theave1model.
• biWM(bivariate model) $$C_{ij}(h) = c_{ij} W_{\nu_{ij}} ( h / s_{ij})$$where$W_nu$is thewhittlemodel 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$$f = \Gamma(\nu_{11} + d/2) * \Gamma(\nu_{22} + d/2) / \Gamma(\nu_{11}) / \Gamma(\nu_{22}) * (\Gamma(\nu_{12}) / \Gamma(\nu_{12}+d/2))^2 * ( s_{12}^{2*\nu_{12}} / s_{11}^{\nu_{11}} / s_{22}^{\nu_{22}} / )^2$$and$\Gamma$is the Gamma function and$d$is the dimension of the space. The constant$m$is the infimum of the function$g$on$[0,\infty)$,$$g(t) = (1/s_{12}^2 +t^2)^{2\nu_{12} + d} (1/s_{11}^2 + t^2)^{-\nu_{11}-d/2} (1/s_{22}^2 + t^2)^{-\nu_{22}-d/2}$$see the reference below for details on the infimum.

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 infitvarioas a part of a linear model definition. Its only parameter is a covariance matrix of appropriate size to match the number of (non-repeated) observations or the number of columns of parametersXin modelmixed, seesophisticated. % \item \code{coxisham} (non-separabel space time model) % \deqn{C(h,t) = (\det M_t)^{-1/2} \ehp(- (h-z t)^\top M_t (h- z t) / % det M_t) % }{C(h,t) = (det M)^{-1/2} exp(- (h-z t)^T M (h- z t) / det M) % } % where % \deqn{ % M_t = \left( \begin{array}{cc} 1+t^2 & -\kappa_3 t^2 \\ -\kappa_3 t^2 & % 1+t^2 \end{array}\right) % }{ % M = rbind(c(1+t^2, -c t^2), c(-c t^2, 1+t^2)) % } % The model is valid in 2 spatial dimensions. % The parameter \eqn{z} is passed as % \eqn{z=(\kappa_1, \kappa_2)}{z=(a, b)}. % The parameter \eqn{\kappa_3}{c} is in \eqn{[-1,1]}.
• coxisham$$C(h, u) = |E + u^\beta D|^{-1/2} \phi([ (h - u \mu)^t (E + u^\beta D)^{-1} (h - u\mu)]^{1/2})$$Here $$muis vector;Eis the identity matrix andDis a correlation matrix with|D| >0. Currently implementation is done only ford=2. The parameter\betais in(0,2]and equals 2 by default. • curlfree(multivariate)$$( - \nabla_x \nabla_x^T ) C_0(x, t)$$C_0is a univariate covariance model that is motion invariant and at least twice differentiable in the first component. The operator is applied to the first component only. The model returns the potential field in the first component, the corresponding curlfree field and field of sources and sinks in the last component. The above formula for the covariance function only gives the part for the curlfree field. The complete matrix-valued correlation function, including all components, is more complicated.C_0is either a spatiotemporal model (thentis the time component) or it is an isotropic model. Then, the firstDspacecoordinates are considered asxcoordinates and the remaining ones astcoordinates. By default,Dspaceequals the dimension of the field (andtis identically0). See also the modelsdivfreeandvector. • cutoff$$C(h)=\phi(h), 0\le h \le dC(h) = b_0 ((dr)^a - h^a)^{2 a}, d \le h \le drC(h) = 0, dr\le h$$The cutoff model is a functional of the covariance function\phi. Here,d>0should be the diameter of the domain on which simulation is done . The parametera>0has been shown to be optimal fora = 1/2ora =1. The parametersrandb_0are chosen internally such thatCis a smooth function. 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,whittleandgencauchy, some sufficient conditions are known. • delayeffect(bivariate)$$C_{11}(h) = C_{22}(h) = C_0(h) \qquad C_{12}(h) = C_0(h + r), C_{21}(h) = C_0(-h + r)$$Hereris a vector of the dimension of the random field, andC_0is a translation invariant, univariate covariance model. • divfree(multivariate)$$( - \Delta E + \nabla \nabla^T ) C_0(x, t)$$C_0is a univariate covariance model that is motion invariant and at least twice differentiable in the first component. The operator is applied to the first component only. The model returns the potential field in the first component, the corresponding divfree field and the field of curl strength in the last component. The above formula for the covariance function only gives the part for the divfree field. The complete matrix-valued correlation function, including all components, is more complicated.C_0is either a spatiotemporal model (thentis the time component) or it is an isotropic model. Then, the firstDspacecoordinates are considered asxcoordinates and the remaining ones astcoordinates. By default,Dspaceequals the dimension of the field (andtis identically0). See also the modelscurlfreeandvector. • EtAxxA(auxiliary function)$$S(x) = E + R^t A^t x x^t A R, \qquad x \in R^3$$whereEandAare arbitrary3 \times 3matrices andRis a rotation matrix,$$R =\left( \begin{array}{lll} \cos (\alpha x_3) & -\sin(\alpha x_3)& 0 \ \sin(\alpha x_3)& \cos (\alpha x_3) & 0 \ 0 & 0 & 1 \end{array} \right)$$This is not a covariance function, but can be used as a submodel for certain classes of non-stationary covariance functions. • Exp$$C(h) = \exp(-\gamma(h))$$where\gammais a valid variogram. If a stationary covariance modelCis given in stead of\gamma, this is automatically turned into a variogram model, i.e.C(h) = \exp(-C(0)+C(h)). %%%%%%%%%%%%%%%%%%%%%%%%%%% • M$$C(h) = M^t \phi(h) M$$Herephiis ak-variate variogram or covariance, andMis anym \times kmatrix. • ma1$$C(h) = (\theta / (1 - (1-\theta) * C_0(h)))^\alpha$$Here,C_0is any correlation function,\alpha \in (0,\infty)and\theta \in (0,1). • ma2$$C(h) = (1 - exp(-\gamma(h)))/\gamma(h)$$Here\gammais a variogram model. • mastein$$C(h, t)=\frac{\Gamma(\nu + \gamma(t))\Gamma(\nu + \delta)}{ \Gamma(\nu + \gamma(t) + \delta) \Gamma(\nu)} W_{\nu + \gamma(t)}(\|h - Vt\|)$$\Gammais the Gamma function;\gamma(t)is a variogram on the real axis;Wis the Whittle-Matern model. Here, the names of covariance models can also be used; the algorithm chooses the corresponding variograms then. The parameter\nuis the smoothness parameter of the Whittle-Matern model (fort=0) and must be positive. Finally,\deltamust be greater than or equal to half the dimension ofh. Instead of the velocity parameterVin original model description, a preceeding anisotropy matrix is chosen appropriately:$$\left( \begin{array}{cc} A & -V \ 0 & 1\end{array}\right)$$A is a spatial transformation matrix. (I.e. (x,t) is multiplied from left on the above matrix and the first elements of the obtained vector are intepreted as new spatial components and only these components are used to form the argument in the Whittle-Matern function.) The last component in the new coordinates is the time which is passed to\gamma. (Velocity is assumed to be zero in the new coordinates.) %Note that %the anisotropy matrix must be such that \eqn{(x,t)} is transformed %into a purely spatial vector, i.e. the entries in %last column of the matrix are all naught. %On the other hand, all entries of the %anisotropy matrices in the submodels that build \eqn{\gamma}{gamma} %is naught except the very last, purely temporal one. Note, that for numerical reasons,\nu+\gamma+dmay not exceed the value 80.0. If exceeded the algorithm fails. • mixedThis model is designed for the use infitvarioto build up linear regression models with fixed effects, mixed effects, including geoadditive parts. The model has two parameters. The first,Xis a matrix of independent variables. The second,b, is a vector of regression coefficients. Furthermore a submodel,covb, may give the covariance structure forb. Letnthe number of (non-repeated) observations. The following combinations are allowed: • onlyXis given. ThenXis a scalar or a vector of lengthn, andXdefines a known mean. • Xandbare given. ThenXis a(n \times m)matrix wheremis the length of the vectorb. Then a fixed effect is defined. • Xandcovbare given. • ifcovbis the modelconstant, then we have a random model (maybe with preceeding model). • ifcovbis any other model then we have a geoadditive part The data in the fitvario may containNAs, but notX. • mqam(multivariate quasi-arithmetic mean)$$C_{ij}(h) = \rho_{ij} \phi(\theta \phi^{-1}(C_i(h)) + (1 - \theta) \phi^{-1}(C_j(h)))$$where\phiis a completely monotone function andC_iare suitable covariance functions. The submodel\phiis given (by name) as first submodel. Since\phiis completely monotone if and only if\phi(\| . \|^2)is a valid covariance function for all dimensions, e.g.stable,gauss,exponential,\phiis given by the name of the corresponding covariance functionC, i.e.phi( . ) = C(sqrt( . )). Warning:RandomFieldscannot check whether the combination of\phiandC_iis valid. • natsc$$C(h) = C_0(h / s)$$WhereC_0is any stationary and isotropic model. The parametersis chosen bynatscsuch that the practical range (or the mathematical range, if finite) is 1. • nonstWM$$C(x, y)=\Gamma(\mu) \Gamma(\nu(x))^{-1/2} \Gamma(\nu(y))^{-1/2} W_{\mu} (\|x-y\|)= 2^{1-\mu} \Gamma(\nu(x))^{-1/2} \Gamma(\nu(y))^{-1/2} \|x-y\|^\mu K_\nu(\|x-y\|)$$where\mu = [\nu(x) + \nu(y)]/2and\nuis a positive function. If\nuis a scalar use the variablenu. If\nuis a function, use the submodelNu. Note that forNuthe usual list structure applies and only the defined covriance models can be used. • nsst(Non-Separable Space-Time model)$$C(h,u)= (\psi(u)+1)^{-\delta/2} \phi(h /\sqrt(\psi(u) +1))$$The parameter\deltamust be greater than or equal to the spatial dimension of the field.\phiis normal mixture model and\psiis a variogram. This model is used for space-time modelling where the spatial component is isotropic. • nugget(multivariat model)$$C(h)= {\rm diag}(1,\ldots,1) 1_{{0}}(h)$$The components of the multivariate vector are always independent. The models adapts the multivariate dimension to the calling model. • parsbiWM(bivariate model)$$C_{ij}(h) = c_{ij} W_{\nu_{ij}} (h / s)$$whereW_nuis thewhittlemodel andi,j=1,2. For (i=j) the constants\nu_{ii}, c_{ii} \ge 0ands>0. For the offdiagonal elements with haveC_{12} = C_{21}. Furthermore,\nu_{12} =\nu_{21} = 0.5 (\nu_{11} + \nu{22})and the scalarc_{12} =c_{21} = \rho_{red} \sqrt{f m c_{11} c_{22}}where$$f = \Gamma(\nu_{11} + d/2) * \Gamma(\nu_{22} + d/2) / \Gamma(\nu_{11}) / \Gamma(\nu_{22}) * (\Gamma(\nu_{12}) / \Gamma(\nu_{12}+d/2))^2$$and\Gammais the Gamma function anddis the dimension of the space. The constantmis the infimum of the functiongon[0,\infty),$$g(t) = (1/s_{12}^2 +t^2)^{2\nu_{12} + d} (1/s_{11}^2 + t^2)^{-\nu_{11}-d/2} (1/s_{22}^2 + t^2)^{-\nu_{22}-d/2}$$see the reference below for details on the infimum. 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$$\gamma(h) = (\gamma_0(h))^\alpha$$or$$C(h) = C_0(0) - [C_0(0) - C_0(h)]^\alpha$$where\gamma_0is a valid variogram orC_0is a valid covariance function, and\alpha \in [0, 1]. • qam(Quasi-arithmetic mean)$$C(h) = \phi(\sum_i \theta_i \phi^{-1}(C_i(h)))$$where\phiis a completely monotone function andC_iare suitable covariance functions. The submodel\phiis given (by name) as first submodel. Since\phiis completely monotone if and only if\phi(\| . \|^2)is a valid covariance function for all dimensions, e.g.stable,gauss,exponential,\phiis given by the name of the corresponding covariance functionC, i.e.phi( . ) = C(sqrt( . )). Warning:RandomFieldscannot check whether the combination of\phiandC_iis valid. • rational(auxiliary)$$S(x) = (a_0 + a_1 * x^t A A^t x)/ (1 + x^t A A^t x)$$where is somed\times dmatrix anda = (a_0, a_1)is a 2-dimensional vector. • Rotat(auxiliary function)$$S^t(x) = x^t R, \qquad x \in R^3$$where andRis a rotation matrix,$$R =\left( \begin{array}{lll} \cos (\alpha x_3) & -\sin(\alpha x_3)& 0 \ \sin(\alpha x_3)& \cos \alpha x_3 & 0 \ 0 & 0 & 1 \end{array} \right)$$This is not a covariance function, but can be used a submodel for certain classes of non-stationary covariance functions. • Stein$$C(h)=a_0 + a_2 (h)^2 + \phi(h), 0\le h \le DC(h)=b_0 (rD - h)^3/(h), r \le h \le rDC(h) = 0, rD \le h$$The Stein model is a functional of the covariance function\phi. Here,D>0should be the diameter of the domain on which simulation is done,r\ge1. The parametersa_0,a_2andb_0are chosen internally such thatCbecomes a smooth function. % Note that the scale parameter for the submodel must be \code{double(0)}. 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 modelfractalBsome sufficient conditions are known. • steinst1(non-separabel space time model)$$C(h, t) = W_{\nu}(y) - \frac{\langle h, z \rangle t}{(\nu - 1)(2\nu + d)} W_{\nu -1}(y)$$Here,W_{\nu}is the Whittle-Matern model with smoothness parameter\nu;y=\|(h,t)\|.zis a vector whose norm must less than or equal to 1. • stp$$C(x,y) = |S_x|^{1/4} |S_y|^{1/4} |A|^{-1/2} \phi(Q(x,y)^{1/2})$$where$$Q(x,y) = c^2 - m^2 + h^t (S_x + 2(m + c)M) A^{-1} (A_y + 2 (m-c)M)h,c = -z^t h + \xi_2(x) - \xi_2(y),A = S_x + S_y + 4 M h h^t Mm = h^t M h .h = H(x) - H(y)$$The parameters are • S_x(strictly) positive definite matrices forx \in R^d • Man arbitraryd \times dmatrix • z \in R^darbitrary • Harbitrary d-variate function onR^d • \xiarbitrary univariate function onR^d • \phia normal mixture model The model allows for mimicking cyclonic behaviour. • tbm2$$C(h) = \frac{d}{dh}\int_0^h \frac{u\phi(u)}{\sqrt{h^2 - u^2}} d u$$for some stationary and isotropic covariance\phithat is valid in at least 2 dimensions. This operator is currently only designed for internal use! • tbm3$$C(h) = \phi(h) + h \phi'(h) / n$$which, forn=1reduced to the standard TBM operator$$C(h) =\frac {d}{d h} h \phi(h)$$for some stationary and isotropic covariance\phithat is valid in at leastn+2dimensions.nshould be an integer. This operator is currently only designed for internal use! • vector(multivariate)$$( -0.5 * (a + 1) \Delta E + a \nabla \nabla^T ) C_0(x, t)$$C_0is a univariate covariance model that is motion invariant and at least twice differentiable in the first component. The operator is applied to the first component only. The parameterais in[-1, 1]. Ifa=-1then the field is curl free; ifa=1then the field is divergence free.C_0is either a spatiotemporal model (thentis the time component) or it is an isotropic model. Then, the firstDspacecoordinates are considered asxcoordinates and the remaining ones astcoordinates. By default,Dspaceequals the dimension of the field (andtis identically0). See also the modelsdivfreeandcurlfree See CovarianceFct for comments on the use of a covariance model. However, for the above sophicated models, the following differences should be considered: • RFparameters()PracticalRangeis usually not defined for the above models • only the list notation can be used, but not the simple model definitions withmodel="name"andparam=c(mean, variance, nugget, scale,...). • the use ofCovarianceis obligatory if the model is non-stationary. • the anisotropy matrix belonging to a hypermodel is applied first to the coordinates before any call of the submodels. 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$$\hbox{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. ##### References Overviews: • see reference list inCovarianceFct ave1, ave2 • Schlather, M. (2010) On some covariance models based on normal scale mixtures.Bernoulli,16, 780-797. (Example 13) biWM, parsbiWM • Gneiting, T., Kleiber, W., Schlather, M. (2010) Matern covariance functions for multivariate random fieldsJASA coxisham • Cox, D.R., Isham, V.S. (1988) A simple spatial-temporal model of rainfall.Proc. R. Soc. Lond. A,415, 317-328. • Schlather, M. (2010) On some covariance models based on normal scale mixtures.Bernoulli,16, 780-797. curlfree • see vector cutoff • Gneiting, T., Sevecikova, H, Percival, D.B., Schlather M., Jiang Y. (2006) Fast and Exact Simulation of Large {G}aussian Lattice Systems in {$R^2$}: Exploring the Limits.J. Comput. Graph. Stat.15, 483-501. • Stein, M. delayeffect • Wackernagel, H. (2003)Multivariate Geostatistics.Berlin: Springer, 3nd edition. divfree • see vector Iaco-Cesare model • de Cesare, L., Myers, D.E., and Posa, D. (2002) FORTRAN programs for space-time modeling.Computers & Geosciences28, 205-212. • de Iaco, S.. Myers, D.E., and Posa, D. (2002) Nonseparable space-time covariance models: some parameteric families.Math. Geol.34, 23-42. vector • Fuselier, E.J. (2006)Refined Error Estimates for Matrix-Valued Radial Basis FunctionsPhD thesis. Texas A&M University • Scheuerer, M. and Schlather, M. (2011) Covariance Models for Random Vector FieldsSubmitted Ma-Stein model • Ma, C. (2003) Spatio-temporal covariance functions generated by mixtures.Math. Geol.,34, 965-975. • Stein, M.L. (2005) Space-time covariance functions.JASA,100, 310-321. ma1/ma2 mixed • Ober, U., Erbe, M., Porcu, E., Schlather, M. and Simianer, H. (2011) Kernel-Based Best Linear Unbiased Prediction with Genomic Data.Submitted. nonstWM/hyperbolic/cauchy • Stein, M. (2005) Nonstationary Spatial Covariance Functions. Tech. Rep., 2005 nsst • Gneiting, T. (1997) Normal scale mixtures and dual probability densitites,J. Stat. Comput. Simul.59, 375-384. • Gneiting, T. (2002) Nonseparable, stationary covariance functions for space-time data,JASA97, 590-600. • Gneiting, T. and Schlather, M. (2001) Space-time covariance models. In El-Shaarawi, A.H. and Piegorsch, W.W.:The Encyclopedia of Environmetrics.Chichester: Wiley. • Zastavnyi, V. and Porcu, E. (2011) Caracterization theorems for the Gneiting class space-time covariances.Bernoulli,??. • Schlather, M. (2010) On some covariance models based on normal scale mixtures.Bernoulli,16, 780-797. Quasi-arithmetic means (qam, mqam) • Porcu, E., Mateu, J. & Cchristakos, G. (2007) Quasi-arithmetic means of covariance functions with potential applications to space-time data. Submitted to Journal of Multivariate Analysis. Paciorek-Stein (steinst1) • Stein, M. (2005) Nonstationary Spatial Covariance Functions. Tech. Rep., 2005 • Paciorek, C. (2003)Nonstationary Gaussian Processes for Regression and Spatial Modelling, Carnegie Mellon University, Department of Statistics, PhD thesis. Stein • Stein, M. stp • Schlather, M. (2008) On some covariance models based on normal scale mixtures.Submitted tbm • Gneiting, T. (1999) On the derivatives of radial positive definite function.J. Math. Anal. Appl,236, 86-99 • Matheron, G. (1973). The intrinsic random functions and their applications.Adv . Appl. Probab.,5, 439-468. ##### See Also CovarianceFct, EmpiricalVariogram, GetPracticalRange, parameter.range, RandomFields, RFparameters, ShowModels. ##### Aliases • sophisticated • Sophisticated ##### 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) 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, list("nugget")),
list("$", scale=p, list("*", list("$", var=p, scale=p, list("gneiting")),
list("whittle", nu=p)
)
)
)
}

# and then
param <- c(NA, runif(5, max=10))
CovarianceFct(0:100, model=gneitingdiff(param))
## instead of formerly CovarianceFct(x,"gneitingdiff",param)`
Documentation reproduced from package RandomFields, version 2.0.71, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.