gpd: The Generalized Pareto Distribution (GPD)

Description Usage Arguments Details References Examples

Description

Density, distribution function, quantile function and random number generation for the Generalized Pareto distribution with location, scale, and shape parameters.

Usage

1
2
3
4
5
6
7
dgpd(x, loc = 0, scale = 1, shape = 0, log.d = FALSE)

rgpd(n, loc = 0, scale = 1, shape = 0)

qgpd(p, loc = 0, scale = 1, shape = 0, lower.tail = TRUE, log.p = FALSE)

pgpd(q, loc = 0, scale = 1, shape = 0, lower.tail = TRUE, log.p = FALSE)

Arguments

x

Vector of observations.

loc, scale, shape

Location, scale, and shape parameters. Can be vectors, but the lengths must be appropriate.

log.d

Logical; if TRUE, the log density is returned.

n

Number of observations.

p

Vector of probabilities.

lower.tail

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

log.p

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

q

Vector of quantiles.

Details

The Generalized Pareto distribution function is given (Pickands, 1975) by

H(y) = 1 - \Big[1 + \frac{ξ (y - μ)}{σ}\Big]^{-1/ξ}

defined on \{y : y > 0, (1 + ξ (y - μ) / σ) > 0 \}, with location μ, scale σ > 0, and shape parameter ξ.

References

Pickands III, J. (1975). Statistical inference using extreme order statistics. Annals of Statistics, 119-131.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
dgpd(2:4, 1, 0.5, 0.01)
dgpd(2, -2:1, 0.5, 0.01)
pgpd(2:4, 1, 0.5, 0.01)
qgpd(seq(0.9, 0.6, -0.1), 2, 0.5, 0.01)
rgpd(6, 1, 0.5, 0.01)

# Generate sample with linear trend in location parameter
rgpd(6, 1:6, 0.5, 0.01)

# Generate sample with linear trend in location and scale parameter
rgpd(6, 1:6, seq(0.5, 3, 0.5), 0.01)

p <- (1:9)/10
pgpd(qgpd(p, 1, 2, 0.8), 1, 2, 0.8)

# Incorrect syntax (parameter vectors are of different lengths other than 1)
## Not run: 
rgpd(1, 1:8, 1:5, 0)
rgpd(10, 1:8, 1, 0.01)

## End(Not run)

eva documentation built on Jan. 13, 2021, 8:34 p.m.