Skip to contents

Function to get the precision matrix of a CBrSPDEobj object

Usage

precision(object, ...)

# S3 method for class 'CBrSPDEobj'
precision(
  object,
  user_nu = NULL,
  user_kappa = NULL,
  user_sigma = NULL,
  user_range = NULL,
  user_tau = NULL,
  user_m = NULL,
  ...
)

Arguments

object

The covariance-based rational SPDE approximation, computed using matern.operators()

...

Currently not used.

user_nu

If non-null, update the shape parameter of the covariance function.

user_kappa

If non-null, update the range parameter of the covariance function.

user_sigma

If non-null, update the standard deviation of the covariance function.

user_range

If non-null, update the range parameter of the covariance function.

user_tau

If non-null, update the parameter tau.

user_m

If non-null, update the order of the rational approximation, which needs to be a positive integer.

Value

The precision matrix.

Examples

# Compute the covariance-based rational approximation of a
# Gaussian process with a Matern covariance function on R
kappa <- 10
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)
fem <- rSPDE.fem1d(x)

# compute rational approximation of covariance function at 0.5
tau <- sqrt(gamma(nu) / (sigma^2 * kappa^(2 * nu) *
  (4 * pi)^(1 / 2) * gamma(nu + 1 / 2)))
op_cov <- matern.operators(
  loc_mesh = x, nu = nu,
  range = range, sigma = sigma, d = 1, m = 2,
  parameterization = "matern"
)

# Get the precision matrix:
prec_matrix <- precision(op_cov)