Learn R Programming

PerformanceAnalytics (version 1.0.4.4)

chart.RollingMean: chart the rolling mean return

Description

A wrapper to create a rolling mean return chart with 95% confidence bands.

Usage

chart.RollingMean(R, width = 12, xaxis = TRUE, ylim = NULL, na.pad =
FALSE, lwd = c(2, 1, 1), ...)

Arguments

R
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
width
number of periods to apply rolling function window over
xaxis
if true, draws the x axis
ylim
set the y-axis limit, same as in plot
na.pad
TRUE/FALSE If TRUE it adds any times that would not otherwise have been in the result with a value of NA. If FALSE those times are dropped.
lwd
set the line width, same as in plot. Specified in order of the main line and the two confidence bands.
...
any other passthru parameters

Examples

Run this code
data(edhec)
chart.RollingMean(edhec[, 9, drop = FALSE])

Run the code above in your browser using DataLab