pargdd | R Documentation |
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.
pargdd(lmom, checklmom=TRUE, symgdd=FALSE, init.para=NULL, snap.tau4=FALSE,
silent=FALSE, trace=FALSE, control=list(abstol=0.0001, maxit=1000), ...)
lmom |
An L-moment object created by |
checklmom |
Should the |
symgdd |
A logical to trigger a symmetrical distribution by |
init.para |
Optional initial values for the parameters used for starting values for the |
snap.tau4 |
A logical to trigger snapping |
silent |
The argument |
trace |
A logical to trigger a message in the main objective function. |
control |
The argument |
... |
Other arguments to pass. |
An R list
is returned.
type |
The type of distribution: |
para |
The parameters of the distribution. |
source |
The source of the parameters: “pargdd”. |
optim |
The results of the parameter optimization call. |
W.H. Asquith
lmomgdd
, cdfgdd
, pdfgdd
, quagdd
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.