# Compute the covariance-based rational approximation of a
# Gaussian process with a Matern covariance function on R
sigma <- 1
nu <- 0.8
range <- 0.2
# create mass and stiffness matrices for a FEM discretization
x <- seq(from = 0, to = 1, length.out = 101)
op_cov <- matern.rational(
loc = x, nu = nu,
range = range, sigma = sigma, m = 2,
parameterization = "matern"
)
# Get the precision matrix:
prec_matrix <- precision(op_cov)
Run the code above in your browser using DataLab