Learn R Programming

PerformanceAnalytics (version 0.9.5)

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, ...)

Arguments

R
a 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.
...
any other passthru parameters

Value

  • A timeseries line charts of the rolling mean, with error bars

Examples

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

Run the code above in your browser using DataLab