LOGNORM function

Three parameter lognormal distribution and L-moments

Three parameter lognormal distribution and L-moments

LOGNORM provides the link between L-moments of a sample and the three parameter log-normal distribution.

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

Arguments

  • x: vector of quantiles
  • xi: vector of lognorm location parameters
  • alfa: vector of lognorm scale parameters
  • k: vector of lognorm 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/Log-normal_distribution for an introduction to the lognormal distribution.

Definition

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

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

Probability density function:

f(x)=ekyy2/2α2π f(x) = \frac{e^{ky-y^2/2}}{\alpha \sqrt{2\pi}}

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)=Φ(x) F(x) = \Phi(x)

where Φ(x)=xϕ(t)dt\Phi(x)=\int_{-\infty}^x \phi(t)dt.

Quantile function: x(F)x(F) has no explicit analytical form.

k=0k=0 is the Normal distribution with parameters ξ\xi and alphaalpha.

L-moments

L-moments are defined for all values of kk.

λ1=ξ+α(1ek2/2)/k \lambda_1 = \xi + \alpha(1 - e^{k^2/2})/k λ2=α/kek2/2[12Φ(k/2)] \lambda_2 = \alpha/k e^{k^2/2} [1 - 2 \Phi(-k/\sqrt{2})]

There are no simple expressions for the L-moment ratios τr\tau_r with r3r \ge 3. Here we use the rational-function approximation given in Hosking and Wallis (1997, p. 199).

Parameters

The shape parameter kk is a function of τ3\tau_3 alone. No explicit solution is possible. Here we use the approximation given in Hosking and Wallis (1997, p. 199).

Given kk, the other parameters are given by

α=λ2kek2/212Φ(k/2) \alpha = \frac{\lambda_2 k e^{-k^2/2}}{1-2 \Phi(-k/\sqrt{2})} ξ=λ1αk(1ek2/2) \xi = \lambda_1 - \frac{\alpha}{k} (1 - e^{k^2/2})

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

Returns

f.lognorm gives the density ff, F.lognorm gives the distribution function FF, invFlognorm gives the quantile function xx, Lmom.lognorm gives the L-moments (λ1\lambda_1, λ2\lambda_2, τ3\tau_3, τ4\tau_4), par.lognorm gives the parameters (xi, alfa, k), and rand.lognorm 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, GENPAR, GEV, GUMBEL, KAPPA, 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.lognorm(ll[1],ll[2],ll[4]) f.lognorm(1800,parameters$xi,parameters$alfa,parameters$k) F.lognorm(1800,parameters$xi,parameters$alfa,parameters$k) invF.lognorm(0.7529877,parameters$xi,parameters$alfa,parameters$k) Lmom.lognorm(parameters$xi,parameters$alfa,parameters$k) rand.lognorm(100,parameters$xi,parameters$alfa,parameters$k) Rll <- regionalLmoments(x,fac); Rll parameters <- par.lognorm(Rll[1],Rll[2],Rll[4]) Lmom.lognorm(parameters$xi,parameters$alfa,parameters$k)
  • Maintainer: Alberto Viglione
  • License: GPL (>= 2)
  • Last published: 2024-05-14

Useful links