GPD {Renext}R Documentation

Generalised Pareto Distribution

Description

Density function, distribution function, quantile function, random generation, hazard and cumulative hazard functions for the Generalised Pareto Distribution.

Usage

   dGPD(x, loc = 0.0, scale = 1.0, shape = 0.0, log = FALSE)
   pGPD(q, loc = 0.0, scale = 1.0, shape = 0.0, lower.tail = TRUE)
   qGPD(p, loc = 0.0, scale = 1.0, shape = 0.0, lower.tail = TRUE)
   rGPD(n, loc = 0.0, scale = 1.0, shape = 0.0)
   hGPD(x, loc = 0.0, scale = 1.0, shape = 0.0)
   HGPD(x, loc = 0.0, scale = 1.0, shape = 0.0) 

Arguments

x, q

Vector of quantiles.

p

Vector of probabilities.

n

Number of observations.

loc

Location parameter μ\mu.

scale

Scale parameter σ\sigma.

shape

Shape parameter ξ\xi.

log

Logical; if TRUE, the log density is returned.

lower.tail

Logical; if TRUE (default), probabilities are Pr[X<=x]\textrm{Pr}[X <= x], otherwise, Pr[X>x]\textrm{Pr}[X > x].

Details

Let μ\mu, σ\sigma and ξ\xi denote loc, scale and shape. The distribution values yy are μy<ymax\mu \leq y < y_{\textrm{max}}.

When ξ0\xi \neq 0, the survival function value for yμy \geq \mu is given by

S(y)=[1+ξ(yμ)/σ]1/ξμ<y<ymaxS(y) = \left[1 + \xi(y - \mu)/\sigma\right]^{-1/ \xi} \qquad \mu < y < y_{\textrm{max}}

where the upper end-point is ymax=y_{\textrm{max}} = \infty for ξ>0\xi >0 and ymax=μσ/ξy_{\textrm{max}} = \mu -\sigma/ \xi for ξ<0\xi <0.

When ξ=0\xi = 0, the distribution is exponential with survival

S(y)=exp[(yμ)/σ]μy.S(y) = \exp\left[- (y - \mu)/\sigma\right] \qquad \mu \leq y.

Value

dGPD gives the density function, pGPD gives the distribution function, qGPD gives the quantile function, and rGPD generates random deviates. The functions hGPD and HGPD return the hazard rate and the cumulative hazard.

Note

The functions are slight adaptations of the [r,d,p,q]gpd functions in the evd package. The main difference is that these functions return NaN when shape is negative, as it might be needed in unconstrained optimisation. The quantile function can be used with p=0 and p=1, then returning the lower and upper end-point.

See Also

fGPD to fit such a distribution by Maximum Likelihood.

Examples

qGPD(p = c(0, 1), shape = -0.2)
shape <- -0.3
xlim <- qGPD(p = c(0, 1), shape = shape)
x <- seq(from = xlim[1], to = xlim[2], length.out = 100)
h <- hGPD(x, shape = shape)
plot(x, h, type = "o", main = "hazard rate for shape < 0")
shape <- 0.2
xlim <- qGPD(p = c(0, 1 - 1e-5), shape = shape)
x <- seq(from = xlim[1], to = xlim[2], length.out = 100)
h <- hGPD(x, shape = shape)
plot(x, h, type = "o", main = "hazard rate shape > 0 ")

[Package Renext version 3.1-4 Index]