vamc (version 0.1.0)

genIndexScen: Simulate a 3D array, numScen by numIndex by numStep, 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.

Description

Simulate a 3D array, numScen by numIndex by numStep, 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, 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

Run this code
# NOT RUN {
genIndexScen(mCov, 100, 360, indexNames, 1 / 12, cForwardCurve, 1)
# }

Run the code above in your browser using DataLab