Learn R Programming

FAdist (version 2.4)

GenPARETO: Generalized Pareto Distribution

Description

Density, distribution function, quantile function and random generation for the generalized Pareto distribution with shape and scale parameters equal to shape and scale, respectively.

Usage

dgp(x,shape=1,scale=1,log=FALSE)
pgp(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE)
qgp(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE)
rgp(n,shape=1,scale=1)

Arguments

x,q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

shape

shape parameter.

scale

scale parameter.

log,log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x].

Value

dgp gives the density, pgp gives the distribution function, qgp gives the quantile function, and rgp generates random deviates.

Details

If X is a random variable distributed according to a generalized Pareto distribution, it has density

f(x) = 1/scale*(1-shape*x/scale)^((1-shape)/shape)

References

Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer

Examples

Run this code
# NOT RUN {
x <- rgp(1000,-.2,10)
hist(x,freq=FALSE,col='gray',border='white')
curve(dgp(x,-.2,10),add=TRUE,col='red4',lwd=2)
# }

Run the code above in your browser using DataLab