pp.cacheVar {pprobeSup}R Documentation

Cache a set of variance matrices

Description

Creates and stores a series of variance matrices estimated from the given return matrix.

Usage

pp.cacheVar(cache, times, retmat, lookback = 250, offset = 0, 
	prefix = "var", FUN = var.shrink.eqcor, verbose = TRUE, 
	...)

Arguments

cache

a character string giving the name of the directory in which to store the files.

times

a vector of elements of the row names of retmat at which estimates of the variance are desired. The lookback and offset arguments limit the earliest time that is possible.

retmat

a matrix of returns for the assets with rows that include the range of times for which variances are desired.

lookback

a single integer giving the number of rows of retmat to use in each estimation.

offset

a single integer giving the number of rows to offset in the estimation. The default of 0 means that the time on the object containing a variance uses the returns with that time. A value of 1 would mean that the latest returns used for an object are 1 time before the time on object name.

prefix

a character string giving the prefix to use in the object names. The rest of the name is the corresponding element of times.

FUN

the function to estimate the variance.

verbose

logical value; if TRUE, then the progress is reported as each evaluation of FUN is completed.

...

additional arguments may be passed to FUN.

Details

While this was written with the intention of it being used to store variance matrices, there is no reason why FUN needs to return a variance matrix. The reason to use cacheing is if either the output is large and/or the computation takes a reasonably long time and the object will be used multiple times.

Value

NULL is returned invisibly.

Side Effects

R objects are saved into the cache directory with suffix rda.

Testing status

Not formally tested.

Revision

This help file was last revised 2013 May 02.

Examples

require(BurStFin)
require(pprobeData)
yearend <- rownames(xassetLogReturns)[cumsum(table(
	substr(rownames(xassetLogReturns), 1, 4)))]
pp.cacheVar("VarianceStash", yearend, xassetLogReturns)

[Package pprobeSup version 1.00 Index]