ExtremesPreprocessing       package:fExtremes       R Documentation

_P_r_e_p_r_o_c_e_s_s_i_n_g _E_x_t_r_e_m_e _V_a_l_u_e _D_a_t_a

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

     A collection and description of functions for preprocessing  data
     for extreme value analysis. Included are tools to  separate data
     beyond a threshold value, to compute blockwise  data like block
     maxima, and to decluster point process data. 

     The functions are:

       'findThreshold'  Upper threshold for a given number of extremes,
       'blocks'         Create data blocks on vectors and time series,
       'blockMaxima'    Block Maxima from a vector or a time series,
       'deCluster'      Declusters clustered point process data.

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

     findThreshold(x, n = NA)
     blocks(x, block = "month", FUN = max)
     blockMaxima(x, block = "month", details = FALSE, doplot = TRUE, ...)
     deCluster(x, run = NA, doplot = TRUE)

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

   block: the block size. A numeric value is interpreted as the number 
           of data values in each successive block. All the data is
          used, so the last block may not contain 'block' observations.
           If the 'data' has a  'times' attribute containing (in an
          object of class '"POSIXct"', or an object that can be
          converted to that class, see 'as.POSIXct') the times/dates of
          each observation, then 'block' may instead take the character
          values '"month"', '"quarter"', '"semester"' or '"year"'. By
          default monthly blocks from daily data are assumed. 

 details: [blockMaxima] - 
           a logical. Should details be printed? 

  doplot: a logical. Should the results be plotted? 

     FUN: the function to be applied. Additional arguments are passed
          by the '...' argument. 

       n: [findThreshold] - 
           a numeric value or vector giving number of extremes above 
          the threshold. If 'n' is not specified, 'n' is  set to an
          integer representing 5% of the data from the  whole data set
          'x'. 

     run: [deCluster] - 
           parameter to be used in the runs method; any two consecutive
           threshold exceedances separated by more than this number of 
          observations/days are considered to belong to different
          clusters. 

       x: a numeric data vector from which 'findThreshold' and 
          'blockMaxima' determine the threshold values and block 
          maxima values.  For the function 'deCluster' the argument 'x'
          represents a numeric vector of threshold exceedances with a
          'times' attribute which should be a numeric vector containing
          either the indices or the times/dates of each exceedance (if
          times/dates, the attribute should be an object of class
          '"POSIXct"' or an object that can be converted to that class;
          see 'as.POSIXct'). 

     ...: additional arguments passed to the FUN or plot function. 

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

     *Finding Thresholds:*  

      The function 'findThreshold' finds a threshold so that a given 
     number of extremes lie above. When the data are tied a threshold
     is  found so that at least the specified number of extremes lie
     above. 

     *Computing Block Maxima:*  

        The function 'blockMaxima' calculates block maxima from a
     vector  or a time series, whereas the function 'blocks' is more
     general and allows for the calculation of an arbitrary function
     'FUN' on blocks. 

     *De-Clustering Point Processes:*  

      The function 'deCluster' declusters clustered point process  data
     so that Poisson assumption is more tenable over a high threshold.

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

     'findThreshold'  
      returns a numeric vector of suitable thresholds. 

     'blockMaxima'  
      returns a numeric vector of block maxima data.

     'deCluster'  
      returns an object for the declustered point process.

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

     Embrechts, P., Klueppelberg, C., Mikosch, T. (1997); _Modelling
     Extremal Events_, Springer Verlag.

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

     'MdaPlots',  'ExtremeIndexPlots',  'GpdFit', 'PotFit'.

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

       
     ## findThreshold -
        xmpExtremes("\nStart: Find Thresold >")
        # Find threshold giving (at least) fifty exceedances 
        # for Danish Fire data
        data(danish)
        findThreshold(danish, n = c(10, 50, 100))    
        
     ## blockMaxima -
        xmpExtremes("\nNext: Compute Block Maxima >")
        # Block Maxima (Minima) for the right and left tails 
        # of the BMW log returns:
        data(bmw)
        par(mfrow = c(2, 1))
        blockMaxima( bmw, block = 100)
        blockMaxima(-bmw, block = 100)     
      
     ## deCluster -
        xmpExtremes("\nNext: De-Cluster Exceedences >")
        # Decluster the 200 exceedances of a particular  
        # threshold in the negative BMW log-return data
        par(mfrow = c(2, 2))
        fit = potFit(-bmw, nextremes = 200) 
        deCluster(fit$fit$data, 30)   

