| pp.historyScenarios {pprobeSup} | R Documentation |
Takes a matrix of prices and produces a three-dimensional array of scenarios based on the historical behavior.
pp.historyScenarios(history, template, number = NULL, which = NULL, prices = NULL, replace = TRUE)
history |
a matrix of positive numbers with column names for the assets. Missing values are not accepted. |
template |
vector with at least two non-negative values giving the position of the rows to be put into the scenarios relative to the starting position. This is typically in increasing order and begins with 0. |
number |
the number of scenarios to be generated with random starting positions. Only one of |
which |
a vector of the locations of starting positions (rows in
Only one of |
prices |
a named numeric vector of the prices to be used as the starting prices. If not given, then the last row of |
replace |
logical value: when random locations are generated, are repeated values allowed? |
a three-dimensional array that is length(template) by
length(prices) by either number or length(which).
The first row of all slices is equal to prices.
if number is given, then the random seed is created or modified.
In test suite, mildly tested.
This help file was last revised 2013 May 02.
pp.priceScenarios, pp.normalScenarios,
scenario.optimizer.
# attach data require(pprobeData) xas.histscenweek <- pp.historyScenarios(xassetPrices[, 1:50], template=c(0, 4), number=100)