genIndexScen: Generate Index Scenerio

Description Usage Arguments Value Examples

View source: R/Step2_ScenarioGeneration.R

Description

Simulate a 3D array, numScen-by-numStep-by-numIndex, of Black-Scholes return factors for numIndex indices in each of numStep time steps and each of numScen scenarios. Covariances among indices are specified in covMatrix. Stepsize is given is dT and interpolated discount factors are given in vDF. Random seed is optional for reproducibility.

Usage

1
2
3
4
5
6
7
8
9
genIndexScen(
  covMatrix,
  numScen,
  numStep,
  indexNames,
  dT = 1/12,
  forwardCurve,
  seed
)

Arguments

covMatrix

A numIndex-by-numIndex matrix of doubles of covariances among numIndex indices.

numScen

An integer of number of scenario (sample paths) to be simulated.

numStep

An integer of number of periods to be simulated.

indexNames

A vector of strings containing index names.

dT

A double of stepsize in years; dT = 1 / 12 would be monthly.

forwardCurve

A vector of doubles of discount rates at each time step.

seed

An integer of the deterministic seed for random sampling.

Value

Outputs a 3D array (numScen-by-numStep-by-numIndex) of index scenarios

Examples

1
genIndexScen(mCov, 100, 360, indexNames, 1 / 12, cForwardCurve, 1)

vamc documentation built on Feb. 28, 2020, 5:08 p.m.