pp.date.meanvarutil {pprobeSup}R Documentation

Compute utilities of random portfolios over times

Description

Returns a matrix of utilities that is the length of the dates argument by the number of random portfolios.

Usage

pp.date.meanvarutil(dates, ahead, risk.aversion, pricemat, 
	alphamat = NULL, vardir = NULL, varprefix = "var", 
	varconstraint = NULL, number.rand = 200, 
	volatility.utility = FALSE, ...)

Arguments

dates

a character vector of times that must match row names of pricemat (and of alphamat if given).

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 NULL (the default), then no constraints on expected returns may be given.

vardir

a character string giving the directory where variances are cached. If NULL (the default), then either no variance constraints are allowed or the variance argument can be given which will mean a static variance throughout.

varprefix

the prefix for the variance objects that have been cached. This is ignored if vardir is NULL.

varconstraint

either NULL or a numeric vector of the same length as dates giving the variance constraint to be imposed at each time.

number.rand

a single integer, the number of random portfolios to generate at each time point.

volatility.utility

a logical value; if TRUE, then a mean-volatility utility is computed. If FALSE (the default), then a mean-variance utility is computed.

...

constraints (arguments to random.portfolio) need to be given. In particular the amount of money in the portfolios needs to be specified (though that is largely immaterial to the utility).

Value

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.

Testing status

Not formally tested.

Revision

This help file was last revised 2013 May 02.

See Also

pp.cacheVar.

Examples

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

[Package pprobeSup version 1.00 Index]