GMRF: GMRF

Description Usage Arguments Value Examples

Description

This function initialises a GMRF with some mean mu and precision matrix Q. The returned object is of class GMRF

Usage

1
2
GMRF(mu = NA, Q = sparseMatrix(i = c(1, 2), j = c(1, 2), x = 4),
  intrinsic = 0, n = NULL, t_axis = 0, rep = data.frame())

Arguments

mu

mean, of class matrix

Q

sparse precision matrix (of class Matrix)

intrinsic

set intrinsic level if Q is singular

n

number of nodes. Note that this can be different from nrow(mu) if the system is multi-variate

t_axis

this is the time horizon for the system under consideration. If you are considering a spatial problem set this to zero.

rep

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

Value

Object of class GMRF

Examples

1
2
3
4
5
6
7
8
require(Matrix)
# Create a GMRF
Q <- sparseMatrix(i=c(1,2,1,2),j=c(1,1,2,2),x=c(1,0.1,0.1,1))
mu <- matrix(c(0,0))
my_GMRF <- GMRF(mu=mu, Q=Q)
print(getPrecision(my_GMRF))
print(getMean(my_GMRF))
print(getDf(my_GMRF))

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