GENPAR {nsRFA} | R Documentation |
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)
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 |
See http://en.wikipedia.org/wiki/Pareto_distribution for an introduction to the Pareto distribution.
Definition
Parameters (3): ξ (location), α (scale), k (shape).
Range of x: ξ < x ≤ ξ + α / k if k>0; ξ ≤ x < ∞ if k ≤ 0.
Probability density function:
f(x) = α^{-1} e^{-(1-k)y}
where y = -k^{-1}\log\{1 - k(x - ξ)/α\} if k \ne 0, y = (x-ξ)/α if k=0.
Cumulative distribution function:
F(x) = 1-e^{-y}
Quantile function: x(F) = ξ + α[1-(1-F)^k]/k if k \ne 0, x(F) = ξ - α \log(1-F) if k=0.
k=0 is the exponential distribution; k=1 is the uniform distribution on the interval ξ < x ≤ ξ + α.
L-moments
L-moments are defined for k>-1.
λ_1 = ξ + α/(1+k)]
λ_2 = α/[(1+k)(2+k)]
τ_3 = (1-k)/(3+k)
τ_4 = (1-k)(2-k)/[(3+k)(4+k)]
The relation between τ_3 and τ_4 is given by
τ_4 = \frac{τ_3 (1 + 5 τ_3)}{5+τ_3}
Parameters
If ξ is known, k=(λ_1 - ξ)/λ_2 - 2 and α=(1+k)(λ_1 - ξ); if ξ is unknown, k=(1 - 3 τ_3)/(1 + τ_3), α=(1+k)(2+k)λ_2 and ξ=λ_1 - (2+k)λ_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.
f.genpar
gives the density f, F.genpar
gives the distribution function F, invF.genpar
gives
the quantile function x, Lmom.genpar
gives the L-moments (λ_1, λ_2, τ_3, τ_4), par.genpar
gives the parameters (xi
, alfa
, k
), and rand.genpar
generates random deviates.
For information on the package and the Author, and for all the references, see nsRFA
.
rnorm
, runif
, EXP
, GENLOGIS
, GEV
, GUMBEL
, KAPPA
, LOGNORM
, P3
; DISTPLOTS
, GOFmontecarlo
, Lmoments
.
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)