drawdowns             package:timeSeries             R Documentation

_C_a_l_c_u_l_a_t_i_o_n_s _o_f _D_r_a_w_d_o_w_n_s

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

     Compute series of drawdowns from financial returns  and ccalculate
     drawdown statisitcs.       

     The functions are:

       'drawdowns'       Generates 'timeSeries' object of drawdown levels,
       'drawdownsStats'  Compute drawdown stats for univariate time series.

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

     drawdowns(x, ...)

     drawdownsStats(x, ...)

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

       x: [drawdowns] - 
           an uni- or multivariate 'timeSeries' object of financial
          returns, 
           [drawdowns] - 
           an univariate 'timeSeries' object of financial returns. 

     ...: [drawdowns] - 
           optional arguments passed to the function 'na.omit', 
           [drawdownsStats] - 
           arguments passed to the function 'drawdowns'.

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

     'drawdowns'
      returns an object of class 'timeSeries'.

     'drawdownsStats'
      returns an object of class 'data.frame' wit the following
     entries:
       '"drawdown"' - the depth of the drawdown, 
       '"from"' - the start date, 
        '"trough"' - the trough period, 
       '"to"' - the end date, 
       '"length"' - the length in number of records, 
       '"peaktrough"' - the peak trough, and , 
       '"recovery"' - the recovery length in number of records.

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

     Peter Carl and Sankalp Upadhyay for code from the contributed  R
     package PerformanceAnalytics.

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

     ## data -
        # Microsoft Data: 
        setRmetricsOptions(myFinCenter = "GMT")
        MSFT = as.timeSeries(data(msft.dat))[1:10, 1:4]
        head(MSFT)

     ## drawdownsStats -
        drawdownsStats(as.timeSeries(data(LPP2005REC))[, "SPI"])

