simVAR: Simulates a VAR(p) with various sparsity patterns

Description Usage Arguments Value

View source: R/simVAR.R

Description

Simulates a VAR(p) with various sparsity patterns

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
simVAR(
  periods,
  k,
  p,
  coef_mat = NULL,
  const = rep(0, k),
  e_dist = rnorm,
  init_y = rep(0, k * p),
  max_abs_eigval = runif(1, 0, 1),
  burnin = periods,
  sparsity_pattern = c("none", "lasso", "hvar"),
  sparsity_options = NULL,
  decay = 1/p,
  seed = NULL,
  ...
)

Arguments

periods

Number of periods to simulate

k

Number of time series

p

Maximum lag number. In case of sparsity_patter="none" this will be the actual number of lags for all variables

coef_mat

Coefficient matrix in companion form. If not provided, one will be simulated

const

constent term of VAR. Default is zero

e_dist

Either a function taking argument n indicating the number of variables in the system, or a matrix of dimensions k x (periods+burnin)

init_y

Initial values. Defaults to zero

max_abs_eigval

Maximum Eigenvalue of companion matrix. Only applicable if coefficient matrix is being simulated

burnin

Number of periods to be used for burnin

sparsity_pattern

The sparsity pattern that should be simulated. Options are: none for a dense VAR, lasso for a VAR with random zeroes, and HVAR for an elementwise hirichical sparsity pattern

sparsity_options

Named list of additional options for when sparsity pattern is lasso or hvar. For lasso the option num_zero determines the number of zeros. For hvar, the options zero_min (zero_max) give the minimum (maximum) of zeroes for each variable in each equation, and the option zeroes_in_self (boolean) determines if any of the cofficients of a variable on itself should be zero.

decay

How much smaller should parameters for laters lags be. The smaller, the larger will early parameters be w.r.t. later ones.

seed

Seed to be used for the simulation

...

additional arguments passed to e_dist

Value

Returns an object of S3 class bigtime.simVAR containing the following

Y

Simulated Data

periods

Number of periods of simulation

k

Number of endogenous variables

p

Maximum lag length; might be shorter due to sparsity patterns

coef_mat

Coefficient Matrix used

is_coef_mat_simulated

TRUE if the coef_mat was simulted, FALSE if it was user provided

const

Constant term

e_dist

Errors used in the construction of the data

init_y

Initial conditions

max_abs_eigval

Maximum eigenvalue to which the companion matrix was constraint

burnin

Burnin period used

sparsity_pattern

Which sparsity pattern was used

sparsity_options

Extra options for the sparsity patterns that were used

seed

seed used for the simulation


YiHou98/bigtime documentation built on Dec. 18, 2021, 7:26 p.m.