GMRF_AR: Autoregressive GMRF

Description Usage Arguments Value Examples

Description

This function initialises an autoregressive block and represents it as a Gaussian Markov Random Field with mean mu and precision matrix Q. Only AR1 processes along the real line are implemented for now. Also a data frame can be specified with more details on the GMRF.

Usage

1
GMRF_AR(n = 10, a = 0.8, order = 1, precinc = 1, df = data.frame())

Arguments

n

number of vertices

a

autoregression coefficient

order

order of AR process (only AR1 implemented for now)

precinc

precision constant (multiplies the template precision matrix)

df

data frame of length n with more details (for example axis, covariate information)

Value

Object of class GMRF with zero mean

Examples

1
2
3
4
5
6
require(Matrix)
# Create a first-order random walk GMRF
my_RW <- GMRF_AR1(n=10, a = 0.8, precinc =2)
print(getPrecision(my_RW))
print(getMean(my_RW))
print(getDf(my_RW))

andrewzm/atminv documentation built on May 10, 2019, 11:14 a.m.