simeQ: Simulate from an inhomogenous GMRF

View source: R/gmrf_sim.R

simeQR Documentation

Simulate from an inhomogenous GMRF

Description

Required the eigen decomposition of a precision matrix

Usage

simeQ(eQ, tol = 1e-09, rank = NULL, k = 1)

Arguments

eQ

an eigen decomposition of a symmetric positive semi-definate matrix corresponding to the precision matrix of an inhomogenous GMRF

tol

tolerance (relative to largest eigen value) for numerical lack of positive-definiteness in ‘Q’.

rank

the rank of the precision matrix. If this is not supplied it it is estimated by comparing the eigen values to tol * largest eigenvalue.

k

optional scaling of the precision matrix. This can be used to save recomputing the eigen decomposition for different smoothing parameters.

Details

Note if rank is suplied and is less than that true rank, the simulation will be from a reduced rank GMRF.

Value

a single draw from with the appropriate conditional covariance structure

Examples

## create a rw2 GMRF precision matrix and simulate
Q <- getQrw(100, order = 2)
eQ <- eigen(Q)
x <- simeQ(eQ, k = exp(5))
plot(x, type = "l")

Faskally/gmrf documentation built on Sept. 21, 2023, 1:16 p.m.