GevDistribution          package:fExtremes          R Documentation

_G_E_V _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 Extreme  Value Distribution, GEV, for the Frechet,
     Gumbel, and  Weibull distributions. 

     The functions are:

       'dgev'           density of the GEV Distribution,
       'pgev'           probability function of the GEV Distribution,
       'qgev'           quantile function of the GEV Distribution,
       'rgev'           random variates from the GEV Distribution.
       '[dpqr]frechet'  Frechet Distribution,
       '[dpqr]gumbel'   Gumbel Distribution,
       '[dpqr]weibull'  Weibull Distribution,
       '[dpqr]evd'      an alternative call for the GEV Distribution.

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

     dgev(x, xi = 1, mu = 0, sigma = 1, log = FALSE)
     pgev(q, xi = 1, mu = 0, sigma = 1, lower.tail = TRUE)
     qgev(p, xi = 1, mu = 0, sigma = 1, lower.tail = TRUE)
     rgev(n, xi = 1, mu = 0, sigma = 1)

     devd(x, loc = 0, scale = 1, shape = 0, log = FALSE)
     pevd(q, loc = 0, scale = 1, shape = 0, lower.tail = TRUE)
     qevd(p, loc = 0, scale = 1, shape = 0, lower.tail = TRUE)
     revd(n, loc = 0, scale = 1, shape = 0)

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

loc, scale, shape: 'loc' is the location parameter,  'scale' the scale
          parameter, and 'shape' is the shape parameter. The default
          values are 'loc=0', 'scale=1', and  'shape=0'. 

     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]'. 

       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, sigma: 'xi' is the shape parameter,  'mu' the location
          parameter, and 'sigma' is the scale parameter. The default
          values are 'xi=1', 'mu=0', and  'sigma=1'. 

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

     *Generalized Extreme Value Distribution:* 

      Computes density, distribution function, quantile function and 
     generates random variates for the Generalized Extreme Value 
     Distribution, GEV, for the Frechet, Gumbel, and Weibull 
     distributions.

_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 variates. 

_N_o_t_e:

     Here we implemented the notation for the arguments as used by the
     GEV functions in the EVIS package or SPlus/FinMetrics  module.
     Additional arguments to these packages are the 'log'  and the
     'lower.tail' arguments, underlying the code from R's 'evd'
     package.

     An alternative usage is proposed by the 'evd' package. There the
     following arguments are used:

     '*gev(x, loc = 0, scale = 1, shape = 0, ...)'

     What you prefer is a matter of taste. The GEV functions from the
     'evd' package are renamed from '*gev' to '*evd' so that both
     versions are available. 

     In addition functions for the density, probability, quantiles, 
     and the generation of random variates for the  Frechet
     '[dpqr]frechet', Gumbel '[dpqr]gumbel', and Weibull
     '[dpqr]weibull' are also available. 

     If you stay with both versions you can access the help page for 
     'evds''s function 'dgev' by 'help(dgev, package="evd")'.

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

     Alec Stephenson for the functions from R's 'evd' package, and 
      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.

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

     'gevFit', 'gpdFit'.

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

     ## *gev  -
        xmpExtremes("\nStart: GEV Frechet >")
        # Create and plot 1000 GEV/Frechet distributed rdv:
        par(mfrow = c(3, 3))
        r = rgev(n = 1000, xi = 1)
        plot(r, type = "l", main = "GEV/Frechet Series")
        ## Plot empirical density and compare with true density:
        ## Omit values greater than 500 from plot
        hist(r[r<10], n = 25, probability = TRUE, xlab = "r", 
          xlim = c(-5, 5), ylim = c(0, 1.1), main = "Density")
        x = seq(-5, 5, by=0.01)
        lines(x, dgev(x, xi = 1), col = 2)
        ## Plot df and compare with true df:
        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, pgev(q, xi=1), col=2)
     ## Compute quantiles, a test:
        qgev(pgev(seq(-5, 5, 0.25), xi = 1), xi = 1) 
        
     ## *gev -
        xmpExtremes("\nNext: GEV Gumbel >")
        # Create and plot 1000 Gumbel distributed rdv:
        ##> r = rgev(n = 1000, xi = 0)
        ##> plot(r, type = "l", main = "Gumbel Series")
        ## Plot empirical density and compare with true density:
        ##>hist(r[abs(r)<10], nclass = 25, freq = FALSE, xlab = "r", 
        ##>   xlim = c(-5,5), ylim = c(0,1.1), main = "Density")
        ##>x = seq(-5, 5, by = 0.01)
        ##>lines(x, dgev(x, xi = 0), col=2)
        ## Plot df and compare with true df:
        ##>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, pgev(q, xi = 0), col = 2)
        ## Compute quantiles, a test:
        ##>qgev(pgev(seq(-5, 5, 0.25), xi = 0), xi = 0)   

     ## *gev -
        xmpExtremes("\nNext: GEV Weibull >")
        # Create and plot 1000 Weibull distributed rdv:
        r = rgev(n = 1000, xi = -1)
        plot(r, type = "l", main = "Weibull Series")
        ## Plot empirical density and compare with true density:
        hist(r[abs(r)<10], nclass = 25, freq = FALSE, xlab = "r", 
          xlim=c(-5,5), ylim=c(0,1.1), main="Density")
        x = seq(-5, 5, by=0.01)
        lines(x, dgev(x, xi = -1), col = 2)
        ## Plot df and compare with true df:
        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, pgev(q, xi = -1), col = 2)
        ## Compute quantiles, a test:
        qgev(pgev(seq(-5, 5, 0.25), xi = -1), xi = -1)   

