GMRF_RW: Random walk GMRF

Description Usage Arguments Value Examples

View source: R/AllConstructor.R

Description

This function initialises a random walk and represents it as a Gaussian Markov Random Field with mean mu and precision matrix Q. Only random walks along the real line, first-order and second-order variants are implemented for now. As with other GMRFs, the user can specify a name. Also a data frame can be specified with more details on the GMRF.

Usage

1
2
GMRF_RW(n = 10, order = 1, precinc = 1, df = data.frame(),
  name = "none")

Arguments

n

number of vertices

order

1 or 2, depending on the order of the random walk

precinc

precision constant (multiples the template precision matrix)

df

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

name

name of GMRF

Value

Object of class GMRF with zero mean

Examples

1
2
3
4
5
6
require(Matrix)
# Createa a first-order random walk GMRF
my_RW <- GMRF_RW(n=10, order=1, precinc =2, name="my_first_RW")
print(getPrecision(my_RW))
print(getMean(my_RW))
print(getDf(my_RW))

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