| pp.date.meanvarutil {pprobeSup} | R Documentation |
Returns a matrix of utilities that is the length of the dates
argument by the number of random portfolios.
pp.date.meanvarutil(dates, ahead, risk.aversion, pricemat, alphamat = NULL, vardir = NULL, varprefix = "var", varconstraint = NULL, number.rand = 200, volatility.utility = FALSE, ...)
dates |
a character vector of times that must match row names of
|
ahead |
a single integer stating the number of rows of prices that will be used to look ahead in the evaluation of the utility. |
risk.aversion |
a single number giving the risk aversion for the utility. |
pricemat |
a numeric matrix with times on the rows and assets along columns giving the prices of the assets throughout the period of interest. |
alphamat |
a numeric matrix with times on the rows and assets along columns
giving the expected returns to be used (in the constraints).
If |
vardir |
a character string giving the directory where variances are cached.
If |
varprefix |
the prefix for the variance objects that have been cached.
This is ignored if |
varconstraint |
either |
number.rand |
a single integer, the number of random portfolios to generate at each time point. |
volatility.utility |
a logical value; if |
... |
constraints (arguments to |
a matrix with number of rows equal to the length of dates and the
number of columns equal to number.rand containing the utility
computed for each random portfolio over each time frame.
Not formally tested.
This help file was last revised 2013 May 02.
# attach data require(pprobeData) # compute random portfolio utilities xa.util20 <- pp.date.meanvarutil(rownames(xassetPrices)[ seq(1, 1401, by=100)], ahead=60, risk.aver=2, pricemat=xassetPrices, gross=1e6, long.only=TRUE, port.size=20, max.weight=.1) # plot density of utilities plot(density(xa.util20))