| pp.normalScenarios {pprobeSup} | R Documentation |
Takes prices, expected returns and a variance matrix – returns a three-dimensional array of scenarios.
pp.normalScenarios(prices, expected.return, variance, ntimes, nscenarios)
prices |
named numeric vector of asset prices. |
expected.return |
numeric vector of expected returns (for each time step).
If named, then these are selected and put into the same
order as |
variance |
variance matrix of the returns (for each time step).
If this has |
ntimes |
the number of time steps in the result. This must be at least 2. |
nscenarios |
the number of scenarios to produce. |
a ntimes by length(prices) by nscenarios array
of prices where the first row in each slice is the input prices.
The random seed is created or modified.
In test suite, mildly tested.
This help file was last revised 2013 May 02.
pp.historyScenarios, pp.priceScenarios,
scenario.optimizer.
# simple case
silly <- pp.normalScenarios(prices=c(A=34.57, B=92.12),
expected.return=c(A=0, B=0), variance=diag(2) * .01,
ntimes=4, nscenarios=5)
# load data
require(pprobeData)
lessSilly <- pp.normalScenarios(prices=xassetPrices[500, 1:50],
expected.return=rep(0,50),
variance=var(xassetLogReturns[1:250,1:50]),
ntimes=63, nscenarios=100)