lmoms: The Sample L-moments and L-moment Ratios

lmomsR Documentation

The Sample L-moments and L-moment Ratios

Description

Compute the sample L-moments. The mathematical expression for sample L-moment computation is shown under TLmoms. The formula jointly handles sample L-moment computation and sample TL-moment (Elamir and Seheult, 2003) computation. A description of the most common L-moments is provided under lmom.ub.

Usage

lmoms(x, nmom=5, no.stop=FALSE, vecit=FALSE)

Arguments

x

A vector of data values.

nmom

The number of moments to compute. Default is 5.

no.stop

A logical to return NULL instead of issuing a stop() if nmom is greater than the sample size or if all the values are equal. This is a very late change (decade+) to the foundational function in the package. Auxiliary coding to above this function to avoid the internal stop() became non-ignorable in large data mining exercises. It was a design mistake to have the stop() and not a warning() instead.

vecit

A logical to return the first two \lambda_i \in 1,2 and then the \tau_i \in 3,\cdots where the length of the returned vector is controlled by the nmom argument. This argument will store the trims (see TLmoms) as NULL used (see the Example that follows).

Value

An R list is returned.

lambdas

Vector of the L-moments. First element is \hat{\lambda}^{(0,0)}_1, second element is \hat{\lambda}^{(0,0)}_2, and so on.

ratios

Vector of the L-moment ratios. Second element is \hat{\tau}^{(0,0)}, third element is \hat{\tau}^{(0,0)}_3 and so on.

trim

Level of symmetrical trimming used in the computation, which will equal NULL if asymmetrical trimming was used.

leftrim

Level of left-tail trimming used in the computation.

rightrim

Level of right-tail trimming used in the computation.

source

An attribute identifying the computational source of the L-moments: “lmoms”.

Note

This function computes the L-moments through the generalization of the TL-moments (TLmoms). In fact, this function calls the default TL-moments with no trimming of the sample. This function is equivalent to lmom.ub, but returns a different data structure. The lmoms function is preferred by the author.

Author(s)

W.H. Asquith

References

Asquith, W.H., 2011, Distributional analysis with L-moment statistics using the R environment for statistical computing: Createspace Independent Publishing Platform, ISBN 978–146350841–8.

Elamir, E.A.H., and Seheult, A.H., 2003, Trimmed L-moments: Computational statistics and data analysis, vol. 43, pp. 299-314.

Hosking, J.R.M., 1990, L-moments—Analysis and estimation of distributions using linear combinations of order statistics: Journal of the Royal Statistical Society, Series B, v. 52, pp. 105–124.

See Also

lmom.ub, TLmoms, lmorph, lmoms.bernstein, vec2lmom

Examples

lmoms(rnorm(30),nmom=4)

vec2lmom(lmoms(rexp(30), nmom=3, vecit=TRUE)) # re-vector

wasquith/lmomco documentation built on April 10, 2024, 4:20 a.m.