rollingCorrelation   package:PerformanceAnalytics   R Documentation

_r_o_l_l_i_n_g _t_r_a_i_n_i_n_g _p_e_r_i_o_d _c_o_v_a_r_i_a_n_c_e/_c_o_r_r_e_l_a_t_i_o_n

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

     This is a wrapper for providing n-period trailing correlations for
     the data provided.

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

     rollingCorrelation(Ra, Rj, width, trim = TRUE, na.rm = FALSE, ...)

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

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

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

   width: the number of periods over which a function is to be
          calculated. Use the value zero (0) to roll the statistic from
          inception 

    trim: TRUE/FALSE, whether to keep alignment caused by NA's 

   na.rm: TRUE/FALSE Remove NA's from the returns? 

     ...: any other passthru parameters 

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

     Example:
     'head(rollingCorrelation(manager.ts@Data[,1],edhec.ts@Data,n=12))'


                Convertible Arbitrage    CTA Global    Distressed
     2003-11-28             0.2591101     0.2762218     0.7516556
     2003-12-31             0.2162078     0.2477113     0.7452179
     2004-01-30             0.3918575     0.3489062     0.7562063
     2004-02-27             0.5331404     0.3905645     0.7088004
     2004-03-31             0.5730389     0.3010877     0.5694478
     2004-04-30             0.5146946     0.3762283     0.4374524 

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

     A data.table of n-period trailing correlations for each column in
     y.

_N_o_t_e:

     Inspired by fMultivar 'rollFun' written by Diethelm Wurtz.

     Assumes that Ra and Rj are sequenced exactly the same and are
     regular.

     Currently assumes that BOTH Ra and Rj are provided

     @todo: Allow _either_ a matrix or data frame for 'Ra' _or_ give
     both 'Ra' and 'Rj' like 'cov'

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

     Peter Carl

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

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

     'cov'

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

     #head(rollingCorrelation(manager.ts@Data[,1],edhec.ts@Data,n=12))

