
Rational approximation of the Matern covariance
Source:R/covariance.functions.R
matern.rational.cov.RdComputes a rational approximation of the Matern covariance function on intervals.
Usage
matern.rational.cov(
h,
order,
kappa,
nu,
sigma,
type_rational = "brasil",
type_interp = "linear",
wl2_table = NULL
)Arguments
- h
Lags at which to compute the covariance. May also be a matrix of lags, in which case a matrix of the same shape is returned.
- order
The order of the approximation
- kappa
Range parameter
- nu
Smoothness parameter
- sigma
Standard deviation
- type_rational
Method used to compute the coefficients of the rational approximation.
- type_interp
Interpolation method for the rational coefficients.
- wl2_table
Table of weighted-L2 coefficients, only used for
type_rational = "wl2". IfNULL, it is taken from the tables stored in the package where there is one for this configuration, and computed otherwise.
Examples
h <- seq(from = 0, to = 1, length.out = 100)
cov.true <- matern.covariance(h, kappa = 10, sigma = 1, nu = 0.8)
cov.approx <- matern.rational.cov(h, kappa = 10, sigma = 1, nu = 0.8, order = 2)
plot(h, cov.true)
lines(h, cov.approx, col = 2)