Learn R Programming

lmomco (version 2.4.14)

pargep: Estimate the Parameters of the Generalized Exponential Poisson Distribution

Description

This function estimates the parameters of the Generalized Exponential Poisson distribution given the L-moments of the data in an L-moment object such as that returned by lmoms. The relations between distribution parameters and L-moments are seen under lmomgep. However, the expectations of order statistic extrema are computed through numerical integration of the quantile function and the fundamental definition of L-moments (theoLmoms.max.ostat). The mean must be \(\lambda_1 > 0\). The implementation here fits the first three L-moments. A distribution having two scale parameters produces more than one solution. The higher L-moments are not consulted as yet in an effort to further enhance functionality. This function has deterministic starting points but on subsequent iterations the starting points do change. If a solution is not forthcoming, try running the whole function again.

Usage

pargep(lmom, checklmom=TRUE, checkdomain=TRUE, maxit=10, verbose=FALSE, ...)

Value

An R

list is returned.

type

The type of distribution: gep.

para

The parameters of the distribution.

convergence

A numeric code on covergence, a value of 0 means solution looks ok.

error

Sum of relative error: \(\epsilon = |(\lambda'_2 - \hat\lambda'_2)/\hat\lambda'_2|\) \(+\) \(|(\lambda_3 - \hat\lambda_3)/\hat\lambda_3|\) for the fitted (prime) and sample (hat, given in lmom) 2nd and 3rd L-moments. A value of 10 means that the \(\tau_2\) and \(\tau_3\) values are outside the domain of the distribution as determined by brute force computations and custom polynomial fits.

its

Iteration count.

source

The source of the parameters: “pargep”.

Arguments

lmom

An L-moment object created by lmoms or vec2lmom.

checklmom

Should the lmom be checked for validity using the are.lmom.valid function. Normally this should be left as the default and it is very unlikely that the L-moments will not be viable (particularly in the \(\tau_4\) and \(\tau_3\) inequality). However, for some circumstances or large simulation exercises then one might want to bypass this check.

checkdomain

A logical controlling whether the empirically derived (approximated) boundaries of the GEP in the \(\tau_2\) and \(\tau_3\) domain are used for early exiting if the lmom do not appear compatible with the distribution.

maxit

The maximum number of iterations. The default should be about twice as big as necessary.

verbose

A logical controlling intermediate results, which is useful given the experimental nature of GEP parameter estimation and if the user is evaluating results at each iteration. The verbosity is subject to change.

...

Other arguments to pass.

Author

W.H. Asquith

See Also

lmomgep, cdfgep, pdfgep, quagep

Examples

Run this code
if (FALSE) {
# Two examples well inside the domain but known to produce difficulty in
# the optimization process; pargep() engineered with flexibility to usually
# hit the proper solutions.
mygepA <- pargep(vec2lmom(c(1,0.305,0.270), lscale=FALSE))
mygepB <- pargep(vec2lmom(c(1,0.280,0.320), lscale=FALSE))
}
if (FALSE) {
gep1 <- vec2par(c(2708, 3, 52), type="gep")
 lmr <- lmomgep(gep1);  print(lmr$lambdas)
gep2 <- pargep(lmr);    print(lmomgep(gep2)$lambdas)
# Note that we are close on matching the L-moments but we do
# not recover the parameters given because to shape parameters.
gep3 <- pargep(lmr, nk=1, nh=2);
x <- quagep(nonexceeds(), gep1)
x <- sort(c(x, quagep(nonexceeds(), gep2)))
plot(x, pdfgep(x, gep1), type="l", lwd=2)
lines(x, pdfgep(x, gep2), lwd=3, col=2)
lines(x, pdfgep(x, gep3), lwd=2, col=3)
}

Run the code above in your browser using DataLab