chart.RollingRegression package:PerformanceAnalytics R Documentation

_A _w_r_a_p_p_e_r _t_o _c_r_e_a_t_e _c_h_a_r_t_s _o_f _r_e_l_a_t_i_v_e _r_e_g_r_e_s_s_i_o_n _p_e_r_f_o_r_m_a_n_c_e _t_h_r_o_u_g_h _t_i_m_e

_D_e_s_c_r_i_p_t_i_o_n:

     A wrapper to create a chart of relative regression performance
     through time

     A group of charts in 'charts.RollingRegression' displays alpha,
     beta, and R-squared estimates in three aligned charts in a single
     device.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

      Ra: an xts, vector, matrix, data frame, timeSeries or zoo object
          of asset returns 

      Rb: return vector of the benchmark asset 

      Rf: risk free rate, in same period as your returns 

   width: number of periods to apply rolling function window over 

attribute: one of "Beta","Alpha","R-Squared" for which attribute to
          show 

    main: set the chart title, same as in 'plot' 

event.labels: TRUE/FALSE whether or not to display lines and labels for
          historical market shock events 

legend.loc: places a legend into one of nine locations on the chart:
          bottomright, bottom, bottomleft, left, topleft, top,
          topright, right, or center. 

  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 to 'chart.TimeSeries' 

_D_e_t_a_i_l_s:

     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

     'chart.RollingQuantileRegression' uses 'rq' rather than 'lm' for
     the regression, and may be more robust to outliers in the data.

_V_a_l_u_e:

     A timeseries line chart of the calculated series

_N_o_t_e:

     Most inputs are the same as "'plot'" and are principally included
     so that some sensible defaults could be set.

_A_u_t_h_o_r(_s):

     Peter Carl

_S_e_e _A_l_s_o:

     'lm' 
      'rq' 

_E_x_a_m_p_l_e_s:

     # 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")

