Description Usage Arguments Value Examples
View source: R/AllConstructor.R
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.
1 2 3 4 |
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 |
Object of class VAR_Gauss which inherits from class GMRF
.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.