Matern spatial covariance structure. The returned dimensionless covariance shape is intended for use inside vsm, which supplies the single overall variance scale.
maternm(x, range = NULL, nu = 0.5, fixed = c(FALSE, FALSE),
distance = NULL, anisotropy = c("none", "geometric"),
angle = pi/2, ratio = 1.5)A list containing the incidence/design matrix in Z and a compiled CovarianceFactor v2 descriptor in covFactor, for use inside vsm.
Numeric coordinate vector or matrix/data frame whose rows give spatial coordinates.
Positive starting range parameter. If NULL, the median positive pairwise distance is used.
Positive starting Matern smoothness parameter.
Logical of length one or two (range, nu), or four with geometric anisotropy (range, nu, angle, ratio); length one is recycled.
Optional finite symmetric q by q distance matrix with zero diagonal, aligned to the unique spatial locations.
"geometric" rotates two-dimensional coordinates by angle and divides the second rotated axis by ratio before computing distances (ASReml anisotropic Matern).
Starting anisotropy angle in (0, pi).
Starting positive anisotropy ratio.
For distance \(d\), the correlation is $$K(d)=\frac{2^{1-\nu}}{\Gamma(\nu)}z^{\nu}K_{\nu}(z),\qquad z=\frac{\sqrt{2\nu}d}{\phi},$$ where \(\phi\) is range. Both range and smoothness are positive and are optimized on log scales. The implementation uses the generic R evaluator and central factor-level numerical derivatives. Repeated coordinate rows are mapped to the same covariance level.
metricm, sar, car, vsm.
if (FALSE) {
vsm(maternm(cbind(xcoord,ycoord)), ism(genotype))
vsm(maternm(time), ism(id))
}
Run the code above in your browser using DataLab