Prec_from_SPDE_wrapper: Precision matrix from SPDE

Description Usage Arguments Value Examples

View source: R/gmrfops.R

Description

This function returns the precision matrix for a GMRF over a triangulation such that it is an approximation to a Gaussian field with a Matern kernel with pre-specified parameters.

Usage

1
Prec_from_SPDE_wrapper(M, K, nu, desired_prec, l)

Arguments

M

the mass matrix of the finite element basis

K

the stiffness matrix of the finite element basis

nu

the smoothness parameter of the Matern kernel

desired_prec

a constant or a vector of length n where each element contains the precision (1 over the marginal standard deviation squared) at each vertex.

l

a constant or a vector of length n where each element contains the practical range (distance at which correlation is 0.1) at each vertex. This should be spatially smooth. Informally, this should vary slower than the field itself, otherwise a good local approximation to the Matern representation is not guaranteed.

Value

Object of class "dgCMatrix"

Examples

1
2
3
4
5
6
7
8
9
require(Matrix)
data(surf_fe)
mu <- matrix(0,nrow(surf_fe$p),1)
Q <- Prec_from_SPDE_wrapper(surf_fe$M,
                            surf_fe$K,
                            nu = 2,
                            desired_prec = 1,
                            l = 100)
my_GMRF <- GMRF(mu=mu, Q=Q,name="my_first_GMRF")

shazhe/mvst0 documentation built on May 29, 2019, 9:20 p.m.