\HeaderA{chart.RollingRegression}{A wrapper to create charts of relative regression performance through time}{chart.RollingRegression}
\aliasA{chart.RollingQuantileRegression}{chart.RollingRegression}{chart.RollingQuantileRegression}
\aliasA{charts.RollingRegression}{chart.RollingRegression}{charts.RollingRegression}
\keyword{ts}{chart.RollingRegression}
\keyword{multivariate}{chart.RollingRegression}
\keyword{distribution}{chart.RollingRegression}
\keyword{models}{chart.RollingRegression}
\keyword{hplot}{chart.RollingRegression}
\begin{Description}\relax
A wrapper to create a chart of relative regression performance through time

A group of charts in \code{charts.RollingRegression} displays alpha, beta, and R-squared estimates in three aligned charts in a single device.
\end{Description}
\begin{Usage}
\begin{verbatim} 
chart.RollingRegression(Ra, Rb, width = 12, Rf = 0, attribute = c("Beta", "Alpha", "R-Squared"), main=NULL, na.pad = TRUE, ...)
chart.RollingQuantileRegression(Ra, Rb, width = 12, Rf = 0, attribute = c("Beta", "Alpha", "R-Squared"), main=NULL, na.pad = TRUE, ...)

charts.RollingRegression(Ra, Rb, width = 12, Rf = 0, main = NULL, legend.loc = NULL, event.labels = NULL, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{Ra}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\item[\code{Rb}] return vector of the benchmark asset 
\item[\code{Rf}] risk free rate, in same period as your returns 
\item[\code{width}] number of periods to apply rolling function window over 
\item[\code{attribute}] one of "Beta","Alpha","R-Squared" for which attribute to show 
\item[\code{main}] set the chart title, same as in \code{plot} 
\item[\code{event.labels}] TRUE/FALSE whether or not to display lines and labels for historical market shock events 
\item[\code{legend.loc}] places a legend into one of nine locations on the chart: bottomright, bottom, bottomleft, left, topleft, top, topright, right, or center. 
\item[\code{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. 
\item[\code{...}] any other passthru parameters to \code{\LinkA{chart.TimeSeries}{chart.TimeSeries}} 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The attribute parameter is probably the most confusing.  In mathematical terms, the different choices yeild the following:

Alpha - shows the y-intercept\\
Beta - shows the slope of the regression line\\
R-Squared - shows the degree of fit of the regression to the data\\

\code{chart.RollingQuantileRegression} uses \code{\LinkA{rq}{rq}} rather than
\code{\LinkA{lm}{lm}} for the regression, and may be more robust to outliers in the data.
\end{Details}
\begin{Value}
A timeseries line chart of the calculated series
\end{Value}
\begin{Note}\relax
Most inputs are the same as "\code{\LinkA{plot}{plot}}" and are principally included so that some sensible defaults could be set.
\end{Note}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{lm}{lm}} \\
\code{\LinkA{rq}{rq}} \\
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# First we load the data
data(managers)
chart.RollingRegression(managers[, 1, drop=FALSE], managers[, 8, drop=FALSE], Rf = .04/12)
charts.RollingRegression(managers[, 1:6], managers[, 8, drop=FALSE], Rf = .04/12, colorset = rich6equal, legend.loc="topleft")
\end{ExampleCode}
\end{Examples}

