VARsim: Simulate from given (pre-estimated) VAR process

Description Usage Arguments Value Examples

View source: R/VARsim.R

Description

Simulate from given (pre-estimated) VAR process

Usage

1
2
3
4
5
6
7
8
9
VARsim(
  V,
  simN = 1000,
  age.max = 122,
  age = 0,
  frequency = 4,
  s = NULL,
  covres = NULL
)

Arguments

V

Output of a VAR Estimation (in package tsDyn)

simN

optional, number of simulated return series to generate, defaults to 1000

age.max

optional,maximum age, defaults to 122

age

optional,starting age, defaults to one, as we usually want to generate all lifetime returns and select from them accordingly

frequency

optional,defaults to 4 (quarterly), could also be 12 (monthly)

s

optional, (from VAR.sim): Starting values (matrix of dimension lag x k) for the VAR to simulate, in our case this defaults to the steady state calculated as $s=(diag(k)-B)^-1 * c$, where k is the dimension of the VAR, B the coefficients of parameters and equations and c the intercepts of the equations, all taken from V

covres

optional, Variance-covariance matrix for the innovations, defaults to the covariance matrix of the VAR given by V as $var(V$residuals)/(V$T-2-V$k)*(V$T-2)$

Value

An array of dimension (T,k,simN) containing simN simulated return series for T years and k variables

Examples

1
2
data(V)
retPA <- VARsim(V,simN=10)

sstoeckl/pensionfinanceLi documentation built on Dec. 2, 2020, 3:26 a.m.