TLmom | R Documentation |
A sample trimmed L-moment (TL-moment) is computed for a vector. The r \ge 1
order of the L-moment is specified as well as the level of symmetrical trimming. A trimmed TL-moment
\hat{\lambda}^{(t_1,t_2)}_r
is
\hat{\lambda}^{(t_1,t_2)}_r = \frac{1}{r}\sum^{n-t_2}_{i=t_1+1}
\left[ \frac{\sum\limits^{r-1}_{k=0}{ (-1)^k {r-1 \choose k}
{i-1 \choose r+t_1-1-k}
{n-i \choose t_2+k}
}}{{n \choose r+t_1+t_2}}
\right] x_{i:n} \mbox{,}
where t_a
represents the trimming level of the t_2
-largest or t_1
-smallest values, r
represents the order of the L-moment, n
represents the sample size, and x_{i:n}
represents the i
th sample order statistic (x_{1:n} \le x_{2:n} \le \dots \le x_{n:n}
).
TLmom(x, order, trim=NULL, leftrim=NULL, rightrim=NULL, sortdata=TRUE)
x |
A vector of data values. |
order |
L-moment order to use in the computations. Default is 1 (the mean). |
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 |
sortdata |
A logical switch on whether the data should be sorted. The default is TRUE. |
An R list
is returned.
lambda |
The TL-moment of order= |
order |
L-moment order computed. Default is 1 (the mean). |
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 |
The presence of the sortdata
switch can be dangerous. L-moment computation requires that the data be sorted into the “order statistics”. Thus the default behavior of sortdata=TRUE
is required when the function is called on its own. In practice, this function would almost certainly not be used on its own because multiple trimmed L-moments would be needed. Multiple trimmed L-moments are best computed by TLmoms
, which calls TLmom
multiple times. The function TLmoms
takes over the sort operation on the data and passes sortdata=FALSE
to TLmom
for efficiency. (The point of this discussion is that CPU time is not wasted sorting the data more than once.)
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.
TLmoms
X1 <- rcauchy(30)
TL <- TLmom(X1,order=2,trim=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.