chart.Regression    package:PerformanceAnalytics    R Documentation

_T_a_k_e_s _a _s_e_t _o_f _r_e_t_u_r_n_s _a_n_d _r_e_l_a_t_e_s _t_h_e_m _t_o _a _m_a_r_k_e_t _b_e_n_c_h_m_a_r_k _i_n _a _s_c_a_t_t_e_r_p_l_o_t

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

     Uses a scatterplot to display the relationship of a set of returns
     to a market benchmark.  Fits a linear model and overlays the
     resulting model.  Also overlays a Loess line for comparison.

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

     chart.Regression(Ra, Rb, Rf, excess.returns = FALSE, reference.grid = TRUE, main = "Title", ylab = NULL, xlab = NULL, xlim = NA, colorset = 1:12, symbolset = 1:12, element.color = "darkgray", legend.loc = NULL, ylog = FALSE, fit = c("loess", "linear", "conditional", "quadratic"), span = 2/3, degree = 1, family = c("symmetric", "gaussian"), ylim = NA, evaluation = 50, legend.cex = 0.8, cex = 0.8, lwd = 2, ...)

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

      Ra: a vector of returns to test, e.g., the asset to be examined 

      Rb: a matrix, data.frame, or timeSeries of benchmark(s) to test
          the asset against 

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

excess.returns: logical; should excess returns be used? 

reference.grid: if true, draws a grid aligned with the points on the x
          and y axes 

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

    ylab: set the y-axis title, same as in 'plot' 

    xlab: set the x-axis title, same as in 'plot' 

    xlim: set the x-axis limit, same as in 'plot' 

colorset: color palette to use 

symbolset: symbols to use, see also 'pch' in 'plot' 

element.color: provides the color for drawing chart elements, such as
          the box lines, axis lines, etc. Default is "darkgray" 

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

    ylog: Not used 

     fit: for values of "loess", "linear", or "conditional", plots a
          line to fit the data.  Conditional lines are drawn separately
          for positive and negative benchmark returns.  "Quadratic" is
          not yet implemented. 

    span: passed to loess line fit, as in 'loess.smooth' 

  degree: passed to loess line fit, as in 'loess.smooth' 

  family: passed to loess line fit, as in 'loess.smooth' 

    ylim: set the y-axis limit, same as in 'plot' 

evaluation: passed to loess line fit, as in 'loess.smooth' 

     cex: set the cex size, same as in 'plot' 

legend.cex: set the legend size 

     lwd: set the line width for fits, same as in 'lines' 

     ...: any other passthru parameters to 'plot' 

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

     scatterplot with fitted lines

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

     Peter Carl

_R_e_f_e_r_e_n_c_e_s:

     Chapter 7 of Ruppert(2004) gives an extensive overview of CAPM,
     its assumptions and deficiencies.

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

     'plot'

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

     data(managers)
     chart.Regression(managers[, 1:2, drop = FALSE], managers[, 8, drop = FALSE], Rf = managers[, 10, drop = FALSE], excess.returns = TRUE, fit = c("loess", "linear"), legend.loc = "topleft")

