Learn R Programming

lmomco (version 2.2.5)

TLmoms: The Sample Trimmed L-moments and L-moment Ratios

Description

Compute the sample trimmed L-moments (TL-moments) for a vector. The level of symmetrical trimming is specified. The mathematical expression for a TL-moment is seen under TLmom. The TLmoms function loops across that expression and the TLmom function for each nmom=$r$ set in the argument list.

Usage

TLmoms(x, nmom, trim=NULL, leftrim=NULL, rightrim=NULL)

Arguments

x
A vector of data values.
nmom
The number of moments to compute. Default is 5.
trim
Level of symmetrical trimming to use in the computations. Although NULL is in the argument list, the default is 0---the usual L-moment is returned.
leftrim
Level of trimming of the left-tail of the sample, which should be left to NULL if no or symmetrical trimming is used.
rightrim
Level of trimming of the right-tail of the sample, which should be left to NULL if no or symmetrical trimming is used.

Value

An R list is returned.

References

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

See Also

TLmom, lmoms, and lmorph

Examples

Run this code
X1 <- rcauchy(30)
TL <- TLmoms(X1,nmom=6,trim=1)

# This trimming with remove the 1 and the two 4s. All values passed on to the TLmom()
# function then are equal and number of L-moments is too big as well. TLmom() returns
# NaN but these are intercepted and systematically changed to NAs.
TLmoms(c(1,2,2,2,4,4), leftrim=1, rightrim=2, nmom=6)$lambdas
# [1]  2  0  0 NA NA NA

Run the code above in your browser using DataLab