Description Usage Arguments Value Examples
View source: R/Step2_ScenarioGeneration.R
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.
1 2 3 4 5 6 7 8 9 | genIndexScen(
covMatrix,
numScen,
numStep,
indexNames,
dT = 1/12,
forwardCurve,
seed
)
|
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. |
Outputs a 3D array (numScen-by-numStep-by-numIndex) of index scenarios
1 | genIndexScen(mCov, 100, 360, indexNames, 1 / 12, cForwardCurve, 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.