GpdDistribution          package:fExtremes          R Documentation

_G_P_D _D_i_s_t_r_i_b_u_t_i_o_n_s _f_o_r _E_x_t_r_e_m_e _V_a_l_u_e _T_h_e_o_r_y

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

     A collection and description of distribution functions  used in
     extreme value theory. The functions compute  density, distribution
     function, quantile function and  generate random deviates for the
     Generalized Pareto  Distribution GPD. 

     The functions are:

       'dgpd'  Density of the GPD Distribution,
       'pgpd'  Probability function of the GPD Distribution,
       'qgpd'  Quantile function of the GPD Distribution,
       'rgpd'  Random variates from the GPD Distribution.

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

     dgpd(x, xi = 1, mu = 0, beta = 1) 
     pgpd(q, xi = 1, mu = 0, beta = 1) 
     qgpd(p, xi = 1, mu = 0, beta = 1) 
     rgpd(n, xi = 1, mu = 0, beta = 1)

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

       n: the number of observations. 

       p: a numeric vector of probabilities. 

       q: a numeric vector of quantiles. 

       x: a numeric vector of quantiles. 

xi, mu, beta: 'xi' is the shape parameter,  'mu' the location
          parameter, and 'beta' is the scale parameter. 

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

     *Generalized Pareto Distribution:* 

      Compute density, distribution function, quantile function and 
     generates random variates for the Generalized Pareto Distribution.

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

     All values are numeric vectors: 
      'd*' returns the density, 
      'p*' returns the probability, 
      'q*' returns the quantiles, and 
      'r*' generates random deviates. 

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

     Alec Stephenson for the functions from R's 'evd' package, 
      Diethelm Wuertz for this R-port.

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

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

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

     ## SOURCE("fExtremes.53A-GpdModelling")

     ## *gpd  -
        xmpExtremes("\nStart: Simulate GPD Distributed sample >")
        par(mfrow = c(2, 2))
        r = rgpd(n = 1000, xi = 1/4)
        plot(r, type = "l", main = "GPD Series")
        
     ## Plot empirical density and compare with true density:
     ## Omit values greater than 500 from plot
        xmpExtremes("\nNext: Plot Empirical and True Density >")
        hist(r, n = 50, probability = TRUE, xlab = "r", 
          xlim = c(-5, 5), ylim = c(0, 1.1), main = "Density")
        x = seq(-5, 5, by = 0.01)
        lines(x, dgpd(x, xi = 1/4), col = "steelblue3")
        
     ## Plot df and compare with true df:
        xmpExtremes("\nNext: Plot Empirical and True Probability >")
        plot(sort(r), (1:length(r)/length(r)), 
          xlim = c(-3, 6), ylim = c(0, 1.1),
          cex = 0.5, ylab = "p", xlab = "q", main = "Probability")
        q = seq(-5, 5, by = 0.1)
        lines(q, pgpd(q, xi = 1/4), col = "steelblue3")
        
     ## Compute quantiles, a test:
        xmpExtremes("\nNext: Compute Quantiles >")
        qgpd(pgpd(seq(-1, 5, 0.25), xi = 1/4 ), xi = 1/4) 
      

