pargdd: Estimate the Parameters of the Gamma Difference Distribution

pargddR Documentation

Estimate the Parameters of the Gamma Difference Distribution

Description

This function estimates the parameters of the Gamma Difference distribution given the L-moments of the data in an ordinary L-moment object (lmoms). The relations between distribution parameters and L-moments are complex (see lmomgdd). The distribution has four parameters. The vector para in the parameter object with a fifth parameter uses that as a trigger between a symmetrical distribution with para[3:4] equals para[1:2] if para[5] = 1. If para[5] is not present, then the distribution can be asymmetrical, or if para[5] is present and set to any value that is not 1, then the distribution can be asymmetrical.

Usage

pargdd(lmom, checklmom=TRUE, symgdd=FALSE, init.para=NULL, snap.tau4=FALSE,
             silent=FALSE, trace=FALSE, control=list(abstol=0.0001, maxit=1000), ...)

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.

symgdd

A logical to trigger a symmetrical distribution by \alpha_2 = \alpha_1 and \beta_1 = \beta_1 and the fifth element of para on the return will be set to 1.

init.para

Optional initial values for the parameters used for starting values for the optim function. If this argument is not set, then an unrigorous attempt is made to guess at the initial parameters using some poor admittedly heuristics. The fifth element, if present, and set to 1, then the symdd is internally set to true.

snap.tau4

A logical to trigger snapping \tau_4 to a nudge above the \{\tau_3, \tau_4\} trajectory of the Pearson Type III distribution. The Gamma Difference only has solution in \{\tau_3, \tau_4\} domain above the Pearson.

silent

The argument silent for try().

trace

A logical to trigger a message in the main objective function.

control

The argument control for optim().

...

Other arguments to pass.

Value

An R list is returned.

type

The type of distribution: gdd.

para

The parameters of the distribution.

source

The source of the parameters: “pargdd”.

optim

The results of the parameter optimization call.

Author(s)

W.H. Asquith

See Also

lmomgdd, cdfgdd, pdfgdd, quagdd

Examples

## Not run: 
# Example of the symmetrical case, see lmomgdd-Note section.
x <- seq(-20, 20, by=0.1); para <- list(para=c(3, 0.4, NA, NA, 1), type="gdd")
slmr  <- lmomgdd(  para);  nara <- pargdd(slmr, symgdd=TRUE)
given <- pdfgdd(x, para);  fit  <- pdfgdd(x, nara)
plot( x, given, type="l", col=8, lwd=4, ylim=range(c(given, fit)))
lines(x, fit,   col="red") # 
## End(Not run)

## Not run: 
# Example of the asymmetrical case, and as of Summer 2024 experiments, it seems
# the author does not quite have limits of GDD implementation known. Though this
# example works, we do not always L-moment recreation from fitted parameters.
x <- seq(-5, 15, by=0.1); para <- list(para=c(3, 1, 1, 3), type="gdd")
slmr  <- lmomgdd(  para);  nara <- pargdd(slmr)
given <- pdfgdd(x, para);  fit  <- pdfgdd(x, nara)
plot( x, given, type="l", col=8, lwd=4, ylim=range(c(a, fit)))
lines(x, fit,   col="red") # 
## End(Not run)

wasquith/lmomco documentation built on Nov. 13, 2024, 4:53 p.m.