samlmu {lmom}R Documentation

Sample L-moments

Description

Computes the “unbiased” sample (trimmed) LL-moments and LL-moment ratios of a data vector.

Usage

samlmu(x, nmom=4, sort.data=TRUE, ratios=sort.data, trim=0)
samlmu.s(x, nmom=4, sort.data=TRUE, ratios=sort.data, trim=0)
.samlmu(x, nmom=4)

Arguments

x

A numeric vector.

nmom

Number of LL-moments to be found.

sort.data

Logical: whether the x vector needs to be sorted.

ratios

Logical. If FALSE, LL-moments are computed; if TRUE (the default), LL-moment ratios are computed.

trim

Degree of trimming. If a single value, symmetric trimming of the specified degree will be used. If a vector of length 2, the two values indicate the degrees of trimming at the lower and upper ends of the “conceptual sample” (Elamir and Seheult, 2003) of order statistics that is used to define the trimmed LL-moments.

Details

samlmu and samlmu.s are functionally identical. samlmu calls a Fortran routine internally, and is usually faster. samlmu.s is written entirely in the S language; it is provided so that users can conveniently see how the calculations are done.

.samlmu is a “bare-bones” version for use in programming. It gives an error if x contains missing values, computes LL-moment ratios and not LL-moments, does not give a warning if all the elements of x are equal, and returns its result in an unnamed vector.

Sample LL-moments are defined in Hosking (1990). Calculations use the algorithm given in Hosking (1996, p.14).

Trimmed sample LL-moments are defined as in Hosking (2007), eq. (15) (a small extension of Elamir and Seheult (2003), eq. (16)). They are calculated from the untrimmed sample LL-moments using the recursions of Hosking (2007), eqs. (12)-(13).

Value

If ratios is TRUE, a numeric vector containing the LL-moments and LL-moment ratios, in the order 1\ell_1, 2\ell_2, t3t_3, t4t_4, etc. If ratios is FALSE, a numeric vector containing the LL-moments in the order 1\ell_1, 2\ell_2, 3\ell_3, 4\ell_4, etc.

Note

The term “trimmed” is used in a different sense from its usual meaning in robust statistics. In particular, the first trimmed LL-moment is in general not equal to any trimmed mean of the data sample.

Author(s)

J. R. M. Hosking jrmhosking@gmail.com

References

Elamir, E. A. H., and Seheult, A. H. (2003). Trimmed L-moments. Computational Statistics and Data Analysis, 43, 299-314.

Hosking, J. R. M. (1990). LL-moments: analysis and estimation of distributions using linear combinations of order statistics. Journal of the Royal Statistical Society, Series B, 52, 105-124.

Hosking, J. R. M. (1996). Fortran routines for use with the method of LL-moments, Version 3. Research Report RC20525, IBM Research Division, Yorktown Heights, N.Y.

Hosking, J. R. M. (2007). Some theory and practical uses of trimmed L-moments. Journal of Statistical Planning and Inference, 137, 3024-3039.

Examples

data(airquality)
samlmu(airquality$Ozone, 6)

# Trimmed L-moment ratios
samlmu(airquality$Ozone, trim=1)

[Package lmom version 3.0 Index]