Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

bvhar (version 2.2.2)

sim_var: Generate Multivariate Time Series Process Following VAR(p)

Description

This function generates multivariate time series dataset that follows VAR(p).

Usage

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
)

Value

T x k matrix

Arguments

num_sim

Number to generated process

num_burn

Number of burn-in

var_coef

VAR coefficient. The format should be the same as the output of coef() from var_lm()

var_lag

Lag of VAR

sig_error

Variance matrix of the error term. By default, diag(dim).

init

Initial y1, ..., yp matrix to simulate VAR model. Try matrix(0L, nrow = var_lag, ncol = dim).

method

Method to compute Σ1/2. Choose between eigen (spectral decomposition) and chol (cholesky decomposition). By default, eigen.

process

Process to generate error term. gaussian: Normal distribution (default) or student: Multivariate t-distribution.

t_param

[Experimental] argument for MVT, e.g. DF: 5.

Details

  1. Generate ϵ1,ϵnN(0,Σ)

  2. For i = 1, ... n, yp+i=(yp+i1T,,yiT,1)TB+ϵi

  3. Then the output is (yp+1,,yn+p)T

Initial values might be set to be zero vector or (ImA1Ap)1c.

References

Lütkepohl, H. (2007). New Introduction to Multiple Time Series Analysis. Springer Publishing.