simQ: Simulate from an inhomogenous GMRF

View source: R/gmrf_sim.R

simQR Documentation

Simulate from an inhomogenous GMRF

Description

Details

Usage

simQ(Q, tol = 1e-09, rank = NULL)

Arguments

Q

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

Details

This function does stuff.

Value

a single draw from with the appropriate covariance structure

Examples

## create a rw2 GMRF precision matrix and simulate
Q <- getQrw(100, order = 2)
x <- simQ(Q)
plot(x)
##
## simulate an AR1 GMRF with toroidal edge correction
Q <- getQar(100, phi = 0.8)
x <- simQ(exp(5)*Q)
plot(x, type = "l")

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