TLmoms | R Documentation |
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.
TLmoms(x, nmom, trim=NULL, leftrim=NULL, rightrim=NULL, vecit=FALSE)
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 |
leftrim |
Level of trimming of the left-tail of the sample, which should be left to |
rightrim |
Level of trimming of the right-tail of the sample, which should be left to |
vecit |
A logical to return the first two |
An R list
is returned.
lambdas |
Vector of the TL-moments. First element is
|
ratios |
Vector of the L-moment ratios. Second element is
|
trim |
Level of symmetrical trimming used in the computation. |
leftrim |
Level of left-tail trimming used in the computation, which will equal |
rightrim |
Level of right-tail trimming used in the computation, which will equal |
source |
An attribute identifying the computational source of the L-moments: “TLmoms”. |
W.H. Asquith
Elamir, E.A.H., and Seheult, A.H., 2003, Trimmed L-moments: Computational Statistics and Data Analysis, v. 43, pp. 299–314.
TLmom
, lmoms
, and lmorph
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
# Example of zero skewness (Berry Boessenkool)
TLmoms(c(3.2, 4.4, 4.8, 2.6, 3.6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.