pargld                package:lmomco                R Documentation

_E_s_t_i_m_a_t_e _t_h_e _P_a_r_a_m_e_t_e_r_s _o_f _t_h_e _G_e_n_e_r_a_l_i_z_e_d _L_a_m_b_d_a _D_i_s_t_r_i_b_u_t_i_o_n

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

     This function estimates the parameters of the Generalized Lambda
     distribution given the L-moments of the data in an ordinary
     L-moment object ('lmom.ub' or a trimmed L-moment object ('TLmoms'
     for 't=1'. The relation between distribution parameters and
     L-moments is seen under 'lmomgld'. There are no simple expressions
     for the parameters in terms of the L-moments. This function is
     considered HIGHLY EXPERIMENTAL and general details of the
     algorithm are provided below. Further, consider that multiple
     parameter solutions are possible with the Generalized Lambda so
     some expertise in the distribution and other aspects are needed.

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

     pargld(lmom,result='best',verbose=FALSE,extract=0,initkh=NULL)

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

    lmom: A L-moment object created by 'lmom.ub', 'pwm2lmom', or
          'TLmoms' with 'trim=0'.

  result: If 'best', then the minimum error solution is returned. If
          'dataframe', then 'data.frame' is returned with sequence of
          valid solutions sorted in ascending error order.

 verbose: A logical switch on the verbosity of output.  Default is
          'verbose=FALSE'.

 extract: If 'result=dataframe' and 'extract' greater than zero, then
          the 'extract=n' returns the 'n'th element of the 'data.frame'
          as if that element was the 'best' solution.

  initkh: A vector of the initial guess of the kappa and h parameters.
          No other regions of parameter space are consulted.

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

     Karian and Dudewicz (2000) summarize six regions of the kappa and
     h space in which the Generalized Lambda distribution is valid for
     suitably choosen alpha. Numerical experimentation suggestions that
     the L-moments are not valid in Regions 1 and 2. However, initial
     guesses of the parameters within each region are used for numerous
     separate 'optim' (the R function) efforts to perform a least
     sum-of-square errors on the following objective function.


 (hat{tau}_3 - tilde{tau}_3)^2 + (hat{tau}_4 - tilde{tau}_4)^2 mbox{, }


     where hat{tau}_r is the L-moment ratio of the data, tilde{tau}_r
     is the estimated value of the L-moment ratio for the fitted
     distribution kappa and h and tau_r is the actual value of the
     L-moment ratio.

     For each optimization a check on the validity of the parameters so
     produced is made-are the parameters consistent with the
     Generalized Lambda distribution and a second check is made on the
     validity of tau_3 and tau_4. If both validity checks return 'TRUE'
     then the optimization is retained if its sum-of-square error is
     less than the previous optimum value. It is possible for a given
     solution to be found outside the starting region of the initial
     guesses. The surface generated by the tau_3 and tau_4 equations
     seen in 'lmomgld' is complex-different initial guesses within a
     given region can yield what appear to be radically different kappa
     and h. Users are encouraged to "play" with alternative solutions
     (see the 'verbose' argument). A quick double check on the
     L-moments from the solved parameters using 'lmomgld' is encouraged
     as well. Karvanen and others (2002, eq. 25) provide an equation
     expressing kappa and h as equal (a symmetrical Generalized Lambda
     distribution) in terms of tau_4 and suggest that the equation be
     used to determine initial values for the parameters. This equation
     is used on an experimental basis for the final optimization
     attempt by this function.

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

     An R 'list' is returned if 'result='best''.

    type: The type of distribution: 'gld'.

    para: The parameters of the distribution.

   error: Smallest sum of square error found.

tau5diff: Difference between hat{tau}_5 and the tilde{tau}_5 of the
          fitted distribution.

  source: The source of the parameters-"pargld".

 attempt: The attempt number that found valid L-moments and parameters
          of GLD.

       x: The location parameter of the distribution.

       a: The scale parameter of the distribution.

       k: The 1st shape parameter of the distribution.

       h: The 2nd shape parameter of the distribution.

tau5_diff: The absolute difference between hat{tau}_5 of data to
          tilde{tau}_5 of the fitted distribution.

   error: The sum of square error found.

initial_k: The starting point of the kappa parameter.

initial_h: The starting point of the h parameter.

_N_o_t_e:

     Although the underlying derivations of the L-moments in terms of
     the parameters are sound and this function uses built-in functions
     of R for the optimization, this function should be considered
     experimental until further notice. The "preferred" solution might
     not be appropriate. This function is not for production code. This
     is a cumbersome method of parameter solution and enhancements or
     total redesign of the algorithm is expected.

_A_u_t_h_o_r(_s):

     W.H. Asquith

_S_o_u_r_c_e:

     R hacking by W.H. Asquith in February 2006 with copy of Karian and
     Dudewicz (2000).

_R_e_f_e_r_e_n_c_e_s:

     Karvanen, J., Eriksson, J., and Koivunen, V., 2002, Adaptive score
     functions for maximum likelihood ICA: Journal of VLSI Signal
     Processing, vol. 32, p. 82-92.

     Karian, Z.A., and Dudewicz, E.J., 2000, Fitting statistical
     distributions-The generalized lambda distribution and generalized
     bootstrap methods:  CRC Press, Boca Raton, FL, 438 p.

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

     'lmom.ub', 'lmomgld', 'cdfgld', 'quagld', 'parTLgld'

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

     lmr1 <- lmom.ub(rnorm(200))
     P <- pargld(lmr1)
     lmr2 <- lmomgld(P)

