GMRF: GMRF

Description Usage Arguments Value Examples

View source: R/AllConstructor.R

Description

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

Usage

1
2
3
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(),
  name = "none")

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)

name

name of GMRF

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,name="my_first_GMRF")
print(getPrecision(my_GMRF))
print(getMean(my_GMRF))
print(getDf(my_GMRF))

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