create_rand_coef_mat: Creates a random coefficient matrix

Description Usage Arguments Value

View source: R/simVAR.R

Description

Creates a random coefficient matrix

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
create_rand_coef_mat(
  k,
  p,
  dist = runif,
  max_abs_eigval = 0.8,
  sparsity_pattern = c("none", "lasso", "hvar"),
  sparsity_options = NULL,
  decay = 0.5,
  ...
)

Arguments

k

number of time series

p

number of lags

dist

distribution to draw coefficients from; must take n as argument indicating number of draws wanted and must return one value per draw wanted, e.g. no vector/matrix returns. Default is uniform distribution: Not currently used

max_abs_eigval

if < 1, then var will be stable

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 fast should coefficient shrink when the lag increases.

...

additional arguments forwarded to dist

Value

Returns a coefficient matrix in companion form.


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