gpdUC                  package:VGAM                  R Documentation

_T_h_e _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:

     Density, distribution function, quantile function and random
     generation for the generalized Pareto distribution (GPD) with
     location parameter 'location', scale parameter 'scale' and shape
     parameter 'shape'.

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

     dgpd(x, location=0, scale=1, shape=0, log=FALSE,
          tolshape0 = sqrt(.Machine$double.eps),
          oobounds.log = -Inf, giveWarning=FALSE)
     pgpd(q, location=0, scale=1, shape=0)
     qgpd(p, location=0, scale=1, shape=0)
     rgpd(n, location=0, scale=1, shape=0)

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

    x, q: vector of quantiles.

       p: vector of probabilities.

       n: number of observations. If 'length(n) > 1' then the length is
          taken to be the number required.

location: the location parameter mu.

   scale: the (positive) scale parameter sigma.

   shape: the shape parameter xi.

     log: Logical. If 'log=TRUE' then the logarithm of the density is
          returned.

tolshape0: Positive numeric. Threshold/tolerance value for resting
          whether xi is zero. If the absolute value of the estimate of
          xi is less than this value then it will be assumed zero and
          an exponential distribution will be used.

oobounds.log, giveWarning: Numeric and logical. The GPD distribution
          has support in the region satisfying '(x-location)/scale > 0'
          and '1+shape*(x-location)/scale > 0'. Outside that region,
          the logarithm of the density is assigned 'oobounds.log',
          which equates to a zero density. It should not be assigned a
          positive number, and ideally is very negative. Since 'gpd'
          uses this function it is necessary to return a finite value
          outside this region  so as to allow for half-stepping. Both
          arguments are in support of this. This argument and others
          match those of 'gpd'.

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

     See 'gpd', the 'VGAM' family function for estimating the two
     parameters by maximum likelihood estimation, for formulae and
     other details. Apart from 'n', all the above arguments may be
     vectors and are recyled to the appropriate length if necessary.

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

     'dgpd' gives the density, 'pgpd' gives the distribution function,
     'qgpd' gives the quantile function, and 'rgpd' generates random
     deviates.

_N_o_t_e:

     The default values of all three parameters, especially xi=0, means
     the default distribution is the exponential.

     Currently, these functions have different argument names compared
     with those in the 'evd' package.

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

     T. W. Yee

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

     Coles, S. (2001) _An Introduction to Statistical Modeling of
     Extreme Values_. London: Springer-Verlag.

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

     'gpd'.

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

     ## Not run: 
     x = seq(-0.2, 3, by=0.01)
     loc = 0; sigma = 1; xi = -0.4
     plot(x, dgpd(x, loc, sigma, xi), type="l", col="blue", ylim=c(0,1),
          main="Blue is density, red is cumulative distribution function",
          sub="Purple are 5,10,...,95 percentiles", ylab="", las=1)
     abline(h=0, col="blue", lty=2)
     lines(qgpd(seq(0.05,0.95,by=0.05), loc, sigma, xi), 
           dgpd(qgpd(seq(0.05,0.95,by=0.05), loc, sigma, xi), loc, sigma, xi),
           col="purple", lty=3, type="h")
     lines(x, pgpd(x, loc, sigma, xi), type="l", col="red")
     abline(h=0, lty=2)
     ## End(Not run)

