| pp.cacheVar {pprobeSup} | R Documentation |
Creates and stores a series of variance matrices estimated from the given return matrix.
pp.cacheVar(cache, times, retmat, lookback = 250, offset = 0, prefix = "var", FUN = var.shrink.eqcor, verbose = TRUE, ...)
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 |
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 |
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 |
FUN |
the function to estimate the variance. |
verbose |
logical value; if |
... |
additional arguments may be passed to |
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.
NULL is returned invisibly.
R objects are saved into the cache directory with suffix
rda.
Not formally tested.
This help file was last revised 2013 May 02.
require(BurStFin)
require(pprobeData)
yearend <- rownames(xassetLogReturns)[cumsum(table(
substr(rownames(xassetLogReturns), 1, 4)))]
pp.cacheVar("VarianceStash", yearend, xassetLogReturns)