TrackingError      package:PerformanceAnalytics      R Documentation

_C_a_l_c_u_l_a_t_e _T_r_a_c_k_i_n_g _E_r_r_o_r _o_f _r_e_t_u_r_n_s _a_g_a_i_n_s_t _a _b_e_n_c_h_m_a_r_k

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

     A measure of the unexplained portion of performance relative to a
     benchmark.

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

     TrackingError(Ra, Rb, scale = 12)

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

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

      Rb: return vector of the benchmark asset 

   scale: number of periods in a year (daily scale = 252, monthly scale
          = 12, quarterly scale = 4) 

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

     Tracking error is calculated by taking the square root of the
     average of the squared deviations between the investment's returns
     and the benchmark's returns, then multiplying the result by the
     square root of the scale of the returns.


 TrackingError = sqrt(sum(Ra - Rb)^2 / (length(Ra) - 1)) * sqrt(scale)

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

     Tracking Error (number)

_N_o_t_e:

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

     Peter Carl

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

     Sharpe, W.F. The Sharpe Ratio,_Journal of Portfolio
     Management_,Fall 1994, 49-58.

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

     'InformationRatio' 'TrackingError'

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

     # First we load the data
     data(edhec)
     edhec.length = dim(edhec)[1]
     start = rownames(edhec[1,])
     start
     end = rownames(edhec[edhec.length,])
     edhec.zoo = zoo(edhec, order.by = rownames(edhec))
     sp500.zoo = download.SP500PriceReturns(start = "1996-12-31", end = end)

     # Now we have to align it as "monthly" data
     time(edhec.zoo) = as.yearmon(time(edhec.zoo))
     time(sp500.zoo) = as.yearmon(time(sp500.zoo))
     data.zoo = merge(edhec.zoo[,9,drop=FALSE],sp500.zoo)
     time(data.zoo) = as.Date(time(data.zoo),format="%b %Y")

     TrackingError(data.zoo[, 1, drop=FALSE], data.zoo[, 2, drop=FALSE])

