VAR_Gauss: Vector auto-regressive model with GMRF represenation

Description Usage Arguments Value Examples

View source: R/AllConstructor.R

Description

This function initialises a vector auto-regressive model and represents it as a Gaussian Markov Random Field with mean mu and precision matrix Q. This constructor differs from other GMRF constructors in that it takes function inputs to define temporally evolving characteristics. The default representation is

x_{k+1} = μ_k + A_kx_k + B_kβ_k + e_k

where e_k \sim \mathcal{N}(0,Q_k). Note that in addition to covariates, a known mean μ_k can be added, this can be omitted and replaced appropriately with entries in B_k. A multi-variate vector auto-regressive model can be speficied by letting A_fun and Qw_fun return matrices a multiple of the dimension of the underlying basis over which the GMRF is defined.

Usage

1
2
3
4
VAR_Gauss(mu_fun = function(k) return(matrix(0, 2, 5)), A_fun = function(k)
  return(Imat(2)), B_fun = function(k) return(emptySp()),
  Qw_fun = function(k) return(Imat(2)), t_axis = c(0:6), Qb = emptySp(),
  name = "none")

Arguments

mu_fun

function of time k, returns matrix of size n

A_fun

function of time k, returns sparse matrix of size n\times n

B_fun

function of time k, returns sparse matrix of size n\times m

Qw_fun

function of time k, returns sparse matrix of size n\times n

t_axis

time axis of process

Qb

prior precision matrix of β; sparse matrix of size m \times m

name

name of VAR

Value

Object of class VAR_Gauss which inherits from class GMRF.

Examples

1
2
3
4
5
6
7
8
require(Matrix)
t_axis <- 0:10
mu <- function(k) return(matrix(0,length(t_axis),1))
A <- function(k)  return(sparsediag(0.4))
B <- function(k)  cBind(Imat(1),k*Imat(1))
Q <- function(k)  return(sparsediag(1))
Qb = bdiag(Imat(1),Imat(1))
VAR <- VAR_Gauss( mu_fun = mu,A=A, B=B, Qw = Q,t_axis = t_axis,Qb=Qb,name="firstVAR")

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