GpdDistribution          package:fExtremes          R Documentation

_G_e_n_e_r_a_l_i_z_e_d _P_a_r_e_t_o _D_i_s_t_r_i_b_u_t_i_o_n

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

     A collection and description of functions to compute the
     generalized Pareto distribution. The  functions compute density,
     distribution function,  quantile function and generate random
     deviates  for the GPD. In addition functions to  compute the true
     moments and to display the distribution and random variates
     changing parameters interactively  are available. 

     The GPD distribution 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 GEV distribution,
       'gpdMoments'  computes true mean and variance,
       'gpdSlider'   displays density or rvs from a GPD.

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

     dgpd(x, xi = 1, mu = 0, beta = 1, log = FALSE) 
     pgpd(q, xi = 1, mu = 0, beta = 1, lower.tail = TRUE) 
     qgpd(p, xi = 1, mu = 0, beta = 1, lower.tail = TRUE) 
     rgpd(n, xi = 1, mu = 0, beta = 1)

     gpdMoments(xi = 1, mu = 0, beta = 1)
     gpdSlider(method = c("dist", "rvs"))

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

     log: a logical, if 'TRUE', the log density is returned. 

lower.tail: a logical, if 'TRUE', the default, then probabilities are
          'P[X <= x]', otherwise, 'P[X > x]'. 

  method: [gpdSlider] - 
                   a character string denoting what should be
          displayed. Either the density and '"dist"' or random variates
          '"rvs"'. 

       n: [rgpd][gpdSim - 
           the number of observations to be generated. 

       p: a vector of probability levels, the desired probability for
          the  quantile estimate (e.g. 0.99 for the 99th percentile). 

       q: [pgpd] - 
           a numeric vector of quantiles. 

       x: [dgpd] - 
           a numeric vector of quantiles. 

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

_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, 
      Alec Stephenson for the functions from R's 'evir' package, 
      Alexander McNeil for the EVIS functions underlying the 'evir'
     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:

     ## rgpd  -
        par(mfrow = c(2, 2), cex = 0.7)
        r = rgpd(n = 1000, xi = 1/4)
        plot(r, type = "l", col = "steelblue", main = "GPD Series")
        grid()
        
     ## dgpd -
        # Plot empirical density and compare with true density:
        # Omit values greater than 500 from plot
        hist(r, n = 50, probability = TRUE, xlab = "r", 
          col = "steelblue", border = "white",
          xlim = c(-1, 5), ylim = c(0, 1.1), main = "Density")
        box()
        x = seq(-5, 5, by = 0.01)
        lines(x, dgpd(x, xi = 1/4), col = "orange")
        
     ## pgpd -
        # Plot df and compare with true df:
        plot(sort(r), (1:length(r)/length(r)), 
          xlim = c(-3, 6), ylim = c(0, 1.1), pch = 19, 
          cex = 0.5, ylab = "p", xlab = "q", main = "Probability")
        grid()
        q = seq(-5, 5, by = 0.1)
        lines(q, pgpd(q, xi = 1/4), col = "steelblue")
        
     ## qgpd -
        # Compute quantiles, a test:
        qgpd(pgpd(seq(-1, 5, 0.25), xi = 1/4 ), xi = 1/4) 

