This function generates multivariate time series dataset that follows VAR(p).
sim_var(
num_sim,
num_burn,
var_coef,
var_lag,
sig_error = diag(ncol(var_coef)),
init = matrix(0L, nrow = var_lag, ncol = ncol(var_coef)),
method = c("eigen", "chol"),
process = c("gaussian", "student"),
t_param = 5
)
T x k matrix
Number to generated process
Number of burn-in
VAR coefficient. The format should be the same as the output of coef()
from var_lm()
Lag of VAR
Variance matrix of the error term. By default, diag(dim)
.
Initial y1, ..., yp matrix to simulate VAR model. Try matrix(0L, nrow = var_lag, ncol = dim)
.
Method to compute eigen
(spectral decomposition) and chol
(cholesky decomposition).
By default, eigen
.
Process to generate error term.
gaussian
: Normal distribution (default) or student
: Multivariate t-distribution.
Generate
For i = 1, ... n,
Then the output is
Initial values might be set to be zero vector or
Lütkepohl, H. (2007). New Introduction to Multiple Time Series Analysis. Springer Publishing.