LOGNORM                package:nsRFA                R Documentation

_T_h_r_e_e _p_a_r_a_m_e_t_e_r _l_o_g_n_o_r_m_a_l _d_i_s_t_r_i_b_u_t_i_o_n _a_n_d _L-_m_o_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

       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

_D_e_t_a_i_l_s:

     See <URL: http://en.wikipedia.org/wiki/Log-normal_distribution>
     for an introduction to the lognormal distribution.

     *Definition*

     Parameters (3): xi (location), alpha (scale), k (shape).

     Range of x: -infty < x <= xi + alpha / k if k>0; -infty < x <
     infty if k=0; xi + alpha / k <= x < infty if k<0.

     Probability density function:

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

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

     Cumulative distribution function:

                            F(x) = Phi(x)

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

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

     k=0 is the Normal distribution with parameters xi and alpha.

     *L-moments*

     L-moments are defined for all values of k.


                lambda_1 = xi + alpha(1 - e^{k^2/2})/k


         lambda_2 = alpha/k e^{k^2/2} [1 - 2 Phi(-k/sqrt{2})]


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

     *Parameters*

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

     Given k, the other parameters are given by

       alpha = frac{lambda_2 k e^{-k^2/2}}{1-2 Phi(-k/sqrt{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.

_V_a_l_u_e:

     'f.lognorm' gives the density f, 'F.lognorm' gives the
     distribution function F, 'invFlognorm' gives the quantile function
     x, 'Lmom.lognorm' gives the L-moments (lambda_1, lambda_2, tau_3,
     tau_4), 'par.lognorm' gives the parameters ('xi', 'alfa', 'k'),
     and 'rand.lognorm' generates random deviates.

_N_o_t_e:

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

_S_e_e _A_l_s_o:

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

_E_x_a_m_p_l_e_s:

     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)

