lmrdia46 | R Documentation |
This function returns a list of the L-kurtosis (\tau_4
and sixth L-moment ratio \tau_6
, respectively) ordinates for construction of L-moment Ratio (L-moment diagrams) that are useful in selecting a distribution to model the data.
lmrdia46()
The lmrdia46
returns a list of the tables for drawing the trajectories of the distributions by its access of .lmomcohash$
t46list
created by the inst/doc/SysDataBuilder02.R
script for sysdata.rda
construction used by the lmomco package itself. The lookup table references below are pointing to the inst/doc/t4t6
subdirectory of the package.
A lookup table for the Exponential Power distribution is provided as PowerExponential.txt
(.lmomcohash$
tau46list$
pwrexp
), and this distribution is a special case of the Asymmetric Exponential Power4 (lmomaep4
) (.lmomcohash$
tau46list$
aep4
).
A lookup table for the Symmetric Stable distribution is provided as StableDistribution.txt
(.lmomcohash$
tau46list$
symstable
).
A lookup table for the Student t distribution is provided as StudentT.txt
(.lmomcohash$
tau46list$
st2
), and this distribution is the same as the Student 3t (lmomst3
) (.lmomcohash$
tau46list$
st3
).
A lookup table for the Tukey Lamda distribution is provided as SymTukeyLambda.txt
(.lmomcohash$
tau46list$
tukeylam
), and this distribution is not quite the same as the Generalized Lambda distribution (lmomgld
) (.lmomcohash$
tau46list$
gld
).
The normal distribution plots as a point in a Tau4-Tau6 L-moment ratio diagram as.lmomcohash$
tau46list$
nor
for which \tau_4^\mathrm{nor} = 30/\pi\times \mathrm{atan}(\sqrt{2}) - 9
= 0.1226017
and \tau_6^\mathrm{nor} = 0.04365901
(numerical integration).
Finally, the Cauchy and Slade distributions are symmetrical and can be plotted as well on Tau4-Tau6 L-moment ratio diagram if we permit their trim=1 TL-moments to be shown instead. These are inserted into the returned list as part of the operation of lmrdia46()
.
Tukey Lambda Notes—The Tukey Lambda distribution is a simpler formulation than the Generalized Lambda.
Q(F) = \frac{1}{\lambda} \biggl[F^\lambda - (1-F)^\lambda \biggr]\mbox{,}
for nonexceedance probability F
and \lambda \ne 0
and
Q(F) = \mathrm{log}\biggl(\frac{F}{1-F}\biggr)\mbox{,}
for \lambda = 0
using the natural logarithm.
Inspection of the distribution formulae inform us that the variation in the distribution, the scaling factor 1/\lambda
to far left in the first definition, for instance, implies that the L-scale (\lambda_2
) is not constant and varies with \lambda
. The second L-moment of the Tukey Lambda (all odd order L-moments are zero) is
\lambda_2 = \frac{2}{\lambda}\biggl[ -\frac{1}{1+\lambda} + \frac{2}{2+\lambda}\biggr]\mbox{, and}
the fourth and sixth L-moments are
\lambda_4 = \frac{2}{\lambda}\biggl[ -\frac{1}{1+\lambda} + \frac{12}{2+\lambda} - \frac{30}{3+\lambda} + \frac{20}{4+\lambda}\biggr]\mbox{,}
\lambda_6 = \frac{2}{\lambda}\biggl[ -\frac{1}{1+\lambda} + \frac{30}{2+\lambda} - \frac{210}{3+\lambda} + \frac{560}{4+\lambda} - \frac{630}{5+\lambda} + \frac{252}{6+\lambda}\biggr]\mbox{\, and}
\tau_4 = \lambda_4 / \lambda_2
and \tau_6 = \lambda_6 / \lambda_2
. The Tukey Lambda is not separately implemented in the lmomco package. It is provided herein for theoretical completeness, but it is possible to implement the Tukey Lambda by the following example:
tukeylam <- .lmomcohash$tau46list$gld_byt6tukeylam lmr1 <- tukeylam[tukeylam$lambda2 == 1, ] # L-scale equal to one (for instance) lmr1 <- vec2lmom(c(0, lmr1$lambda2, 0, lmr1$tau4, 0, lmr1$tau6)) tuk1 <- pargld(lmr1, aux="tau6") print(tuk1$para, 12) # xi alpha kappa h # 2.50038766315e-04 -5.82180675380e+03 -1.71745206920e-04 -1.71702273015e-04 lambda <- mean(tuk1$para[3:4]) # remember optimization is used for parameters in # GLD parlance and so the two shape parameters are not constrained in pargld() # to be numerically identical. So, here, let us compute a mean of the two and then # use that as the Lambda in the distribution. eps <- 1/tuk1$para[2] - lambda message("EPS should be very close to zero, eps = ", eps, " !!!!!") tuk2 <- vec2par(c(0, 1/lambda, lambda, lambda), type="gld") # now Tukey Lambda lmr2 <- lmomgld(tuk2) "ofunc" <- function(lambda, lambda2=NA) { tukeyL2 <- ( 2 / lambda ) * ( -1 / (1+lambda) + 2 / (2+lambda) ) return(lambda2 - tukeyL2) } lam <- uniroot(ofunc, interval=c(-1, 1), lambda2=1)$root tuk3 <- vec2par(c(0, 20/lam, lam, lam), type="gld") lmr3 <- lmomgld(tuk3) gld5 <- pargld(lmr3, aux="tau5"); gldlmr5 <- theoLmoms(gld5, nmom=6) gld6 <- pargld(lmr3, aux="tau6"); gldlmr6 <- theoLmoms(gld6, nmom=6) plotlmrdia46(lmrdia46(), nogld_byt5opt=FALSE) points(gldlmr5$ratios[4], gldlmr5$ratios[6], pch=16, col="purple") points(gldlmr6$ratios[4], gldlmr6$ratios[6], pch=21, col="purple", bg="white") # See how GLD by tau5 optimization, which leaves Tau6 to float plots on the # "gld_byt5opt" trajectory, but GLD by tau6 optimization, plots on the Tukey # Lambda line, and gld6$para[2] / (1/gld6$para[3]) is equal to the 20 in the # parameter setting for tuk3.
The finally differences in the L-moments between the two lmr
objects are all are reasonably close to zero with the recognition that optim()
has been involved getting us close to the Tukey Lambda that we desire as a GLD with fixed shape parameters and scale factor equal to the inverse of the shape parameter. The demonstration to how to thus acquire a Tukey Lambda from GLD implementation in the lmomco package is thus shown.
An R list
is returned.
aep4 |
|
gld_byt5opt |
|
gld_byt6tukeylam |
|
nor |
|
pdq4 |
|
pwrexp |
|
st2 |
|
st3 |
|
symstable |
|
tukeylam |
(reference copy of |
cau |
|
sla |
|
W.H. Asquith
plotlmrdia46
, lmrdia
lratios <- lmrdia46()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.