GENPAR                 package:nsRFA                 R Documentation

_T_h_r_e_e _p_a_r_a_m_e_t_e_r _g_e_n_e_r_a_l_i_z_e_d _P_a_r_e_t_o _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:

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

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

     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)

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

       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

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

     See <URL: http://en.wikipedia.org/wiki/Pareto_distribution> for an
     introduction to the Pareto distribution.

     *Definition*

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

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

     Probability density function:

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

     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) = 1-e^{-y}


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

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

     *L-moments*

     L-moments are defined for k>-1.


                     lambda_1 = xi + alpha/(1+k)]


                    lambda_2 = alpha/[(1+k)(2+k)]


                         tau_3 = (1-k)/(3+k)


                   tau_4 = (1-k)(2-k)/[(3+k)(4+k)]


     The relation between tau_3 and tau_4 is given by

              tau_4 = frac{tau_3 (1 + 5 tau_3)}{5+tau_3}


     *Parameters*

     If xi is known, k=(lambda_1 - xi)/lambda_2 - 2 and
     alpha=(1+k)(lambda_1 - xi); if xi is unknown, k=(1 - 3 tau_3)/(1 +
     tau_3), alpha=(1+k)(2+k)lambda_2 and 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.

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

     '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 (lambda_1, lambda_2, tau_3,
     tau_4), 'par.genpar' gives the parameters ('xi', 'alfa', 'k'), and
     'rand.genpar' 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', 'GEV', 'GUMBEL', 'KAPPA',
     'LOGNORM', '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.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)

