gpd: Generalised Pareto Distribution (GPD) Density, distribution...

Description Usage Arguments Details References Examples

Description

Generalised Pareto Distribution (GPD) 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
8
9
dgpd(x, loc = 0, scale = 1, shape = 0, log.d = FALSE)

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

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

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

experimental.dgpd(x, loc = 0, scale = 1, shape = 0, log.d = 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.

q

Vector of quantiles.

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).

p

Vector of probabilities.

n

Number of observations.

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

Brian Bader, Jun Yan. "eva: Extreme Value Analysis with Goodness-of-Fit Testing." R package version (2016)

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)
## [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

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

## Also incorrect syntax
# rgpd(10, 1:8, 1, 0.01)

K-Molloy/tevt documentation built on Dec. 18, 2021, 2:34 a.m.