The Sample Trimmed L-moments and L-moment Ratios

Share:

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

1
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.

lambdas

Vector of the TL-moments. First element is \hat{λ}^{(t_1,t_2)}_1, second element is \hat{λ}^{(t_1,t_2)}_2, and so on.

ratios

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

trim

Level of symmetrical trimming used in the computation.

leftrim

Level of left-tail trimming used in the computation, which will equal trim if symmetrical trimming was used.

rightrim

Level of right-tail trimming used in the computation, which will equal trim if symmetrical trimming was used.

source

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

Author(s)

W.H. Asquith

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

1
2
3
4
5
6
7
8
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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.