GENPAR function

Three parameter generalized Pareto distribution and L-moments

Three parameter generalized Pareto distribution and L-moments

GENPAR provides the link between L-moments of a sample and the three parameter generalized Pareto distribution.

f.genpar (x, xi, alfa, k) F.genpar (x, xi, alfa, k) invF.genpar (F, xi, alfa, k) Lmom.genpar (xi, alfa, k) par.genpar (lambda1, lambda2, tau3) rand.genpar (numerosita, xi, alfa, k)

Arguments

  • x: vector of quantiles
  • xi: vector of genpar location parameters
  • alfa: vector of genpar scale parameters
  • k: vector of genpar shape parameters
  • F: vector of probabilities
  • lambda1: vector of sample means
  • lambda2: vector of L-variances
  • tau3: vector of L-CA (or L-skewness)
  • numerosita: numeric value indicating the length of the vector to be generated

Details

See https://en.wikipedia.org/wiki/Pareto_distribution for an introduction to the Pareto distribution.

Definition

Parameters (3): ξ\xi (location), α\alpha (scale), kk (shape).

Range of xx: ξ<xξ+α/k\xi < x \le \xi + \alpha / k if k>0k>0; ξx<\xi \le x < \infty if k0k \le 0.

Probability density function:

f(x)=α1e(1k)y f(x) = \alpha^{-1} e^{-(1-k)y}

where y=k1log{1k(xξ)/α}y = -k^{-1}\log\{1 - k(x - \xi)/\alpha\} if k0k \ne 0, y=(xξ)/αy = (x-\xi)/\alpha if k=0k=0.

Cumulative distribution function:

F(x)=1ey F(x) = 1-e^{-y}

Quantile function: x(F)=ξ+α[1(1F)k]/kx(F) = \xi + \alpha[1-(1-F)^k]/k if k0k \ne 0, x(F)=ξαlog(1F)x(F) = \xi - \alpha \log(1-F) if k=0k=0.

k=0k=0 is the exponential distribution; k=1k=1 is the uniform distribution on the interval ξ<xξ+α\xi < x \le \xi + \alpha.

L-moments

L-moments are defined for k>1k>-1.

λ1=ξ+α/(1+k)] \lambda_1 = \xi + \alpha/(1+k)] λ2=α/[(1+k)(2+k)] \lambda_2 = \alpha/[(1+k)(2+k)] τ3=(1k)/(3+k) \tau_3 = (1-k)/(3+k) τ4=(1k)(2k)/[(3+k)(4+k)] \tau_4 = (1-k)(2-k)/[(3+k)(4+k)]

The relation between τ3\tau_3 and τ4\tau_4 is given by

τ4=τ3(1+5τ3)5+τ3 \tau_4 = \frac{\tau_3 (1 + 5 \tau_3)}{5+\tau_3}

Parameters

If ξ\xi is known, k=(λ1ξ)/λ22k=(\lambda_1 - \xi)/\lambda_2 - 2 and α=(1+k)(λ1ξ)\alpha=(1+k)(\lambda_1 - \xi); if ξ\xi is unknown, k=(13τ3)/(1+τ3)k=(1 - 3 \tau_3)/(1 + \tau_3), α=(1+k)(2+k)λ2\alpha=(1+k)(2+k)\lambda_2 and ξ=λ1(2+k)λ2\xi=\lambda_1 - (2+k)\lambda_2.

Lmom.genpar and par.genpar accept input as vectors of equal length. In f.genpar, F.genpar, invF.genpar and rand.genpar parameters (xi, alfa, k) must be atomic.

Returns

f.genpar gives the density ff, F.genpar gives the distribution function FF, invF.genpar gives the quantile function xx, Lmom.genpar gives the L-moments (λ1\lambda_1, λ2\lambda_2, τ3\tau_3, τ4\tau_4), par.genpar

gives the parameters (xi, alfa, k), and rand.genpar generates random deviates.

Note

For information on the package and the Author, and for all the references, see nsRFA.

See Also

rnorm, runif, EXP, GENLOGIS, GEV, GUMBEL, KAPPA, LOGNORM, P3; DISTPLOTS, GOFmontecarlo, Lmoments.

Examples

data(hydroSIMN) annualflows summary(annualflows) x <- annualflows["dato"][,] fac <- factor(annualflows["cod"][,]) split(x,fac) camp <- split(x,fac)$"45" ll <- Lmoments(camp) parameters <- par.genpar(ll[1],ll[2],ll[4]) f.genpar(1800,parameters$xi,parameters$alfa,parameters$k) F.genpar(1800,parameters$xi,parameters$alfa,parameters$k) invF.genpar(0.7161775,parameters$xi,parameters$alfa,parameters$k) Lmom.genpar(parameters$xi,parameters$alfa,parameters$k) rand.genpar(100,parameters$xi,parameters$alfa,parameters$k) Rll <- regionalLmoments(x,fac); Rll parameters <- par.genpar(Rll[1],Rll[2],Rll[4]) Lmom.genpar(parameters$xi,parameters$alfa,parameters$k)
  • Maintainer: Alberto Viglione
  • License: GPL (>= 2)
  • Last published: 2024-05-14

Useful links