genIndexScen {vamc}R Documentation

Generate Index Scenerio

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

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

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

[Package vamc version 0.2.1 Index]