pp.normalScenarios {pprobeSup}R Documentation

Generate normally distributed scenarios

Description

Takes prices, expected returns and a variance matrix – returns a three-dimensional array of scenarios.

Usage

pp.normalScenarios(prices, expected.return, variance, ntimes, 
	nscenarios)

Arguments

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 prices.

variance

variance matrix of the returns (for each time step). If this has dimnames, then the rows and columns are selected and put into the same order as prices.

ntimes

the number of time steps in the result. This must be at least 2.

nscenarios

the number of scenarios to produce.

Value

a ntimes by length(prices) by nscenarios array of prices where the first row in each slice is the input prices.

Side effects

The random seed is created or modified.

Testing status

In test suite, mildly tested.

Revision

This help file was last revised 2013 May 02.

See Also

pp.historyScenarios, pp.priceScenarios, scenario.optimizer.

Examples

# 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)

[Package pprobeSup version 1.00 Index]