Description Usage Arguments Details Value Author(s) See Also Examples
Creates a results timeseries of a function applied over a rolling window.
1 2 | apply.rolling(R, width, trim = TRUE, gap = 12, by = 1, FUN = "mean",
...)
|
R |
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns |
width |
number of periods to apply rolling function window over |
gap |
numeric number of periods from start of series to use to train risk calculation |
trim |
TRUE/FALSE, whether to keep alignment caused by NA's |
FUN |
any function that can be evaluated using a
single set of returns (e.g., rolling beta won't work, but
|
by |
calculate FUN for trailing width points at every by-th time point. |
... |
any other passthru parameters |
Wrapper function for rollapply
to hide
some of the complexity of managing single-column zoo
objects.
A timeseries in a zoo object of the calculation results
Peter Carl
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.