Description Usage Arguments Details Value Examples
create_inventory
constructs companion matrix for VAR(p) model.
1 | comp_f_state(phi, Q, H, con, n, k)
|
phi |
Diagoanl matrix of dimension k x k with vector autoregressive coefficients. |
Q |
A matrix of . |
H |
A matrix of lambadas from Multi-Move Gibbs sampler in companion form. |
con |
A scalar, where con = 1 for model with intercept, con = 0 for model without intercept. |
n |
Number of variables. |
k |
Number of states (number of factors). |
The function runs inside the Multi-Move Gibbs sampler.
A List with phi, Q, H in companion form.
1 2 3 4 5 6 7 8 9 10 11 12 | yt <- as.matrix(t(Xmat))
k <- 2
n <- dim(yt)[1]
lambdasim <- matrix(rep(rnorm(n,0,1)*0.1,k),
nrow = n, ncol = k, byrow = TRUE)
diag(lambdasim) <- 1
lambdasim[upper.tri(lambdasim)] <- 0
lambda <- lambdasim
phi <- diag(rnorm(k,0,1))
Q <- as.matrix(diag(0.1,k))
const <- 0
matcomp <- comp_f_state(phi,Q,lambda,const)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.