theoTLmoms {lmomco} | R Documentation |
Compute the theoretrical trimmed L-moments (TL-moments) for a vector. The level of symmetrical or asymmetrical trimming is specified. A theoretrical TL-moment in integral form is
λ^{(t_1,t_2)}_r = underbrace{frac{1}{r}}_{stackrel{mbox{average}}{mbox{of terms}}} sum^{r-1}_{k=0} overbrace{(-1)^k}^{mbox{differences}} underbrace{ r-1 choose k }_{mbox{combinations}} frac{overbrace{(r+t_1+t_2)!}^{mbox{sample size}}: I^{(t_1,t_2)}_r} {underbrace{(r+t_1-k-1)!}_{mbox{left tail}} underbrace{(t_2+k)!}_{mbox{right tail}}} mbox{, in which }
I^{(t_1,t_2)}_r = int^1_0 underbrace{X(F)}_{stackrel{mbox{quantile}}{mbox{function}}} times overbrace{F^{r+t_1-k-1}}^{mbox{left tail}} overbrace{(1-F)^{t_2+k}}^{mbox{right tail}} ,mathrm{d}F mbox{,}
where X(F) is the quantile function of the random variable X for nonexceedance probability F,
t_1 represents the trimming level of the t_1-smallest, t_2 represents the trimming level of the t_2-largest
values, r represents the order of the L-moments. This function loops across the above equation for each nmom
set in
the argument list. The function X(F) is computed through the par2qua
function. The distribution type is determined using the type
attribute of the para
argument—the parameter object.
theoTLmoms(para,nmom=5,trim=NULL,leftrim=NULL, rightrim=NULL,verbose=FALSE)
para |
A distribution parameter object of this package vec2par . |
nmom |
The number of moments to compute. Default is 5. |
trim |
Level of symmetrical trimming to use in the computations.
Although NULL 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. |
rightrim |
Level of trimming of the right-tail of the sample. |
verbose |
Toggle verbose output. Because the R function integrate is used to perform the numerical integration, it might be useful to see selected messages regarding the numerical integration. |
An R list
is returned.
lambdas |
Vector of the TL-moments. First element is λ^{(t_1,t_2)}_1, second element is λ^{(t_1,t_2)}_2, and so on. |
ratios |
Vector of the L-moment ratios. Second element is tau^{(t_1,t_2)}, third element is tau^{(t_1,t_2)}_3 and so on. |
trim |
Level of symmetrical trimming used in the computation, which will equal NULL if asymmetrical trimming was used. |
leftrim |
Level of left-tail trimming used in the computation. |
rightrim |
Level of right-tail trimming used in the computation. |
source |
An attribute identifying the computational source of the L-moments: “theoTLmoms”. |
W.H. Asquith
Hosking, J.R.M., 1990, L-moments–Analysis and estimation of distributions using linear combinations of order statistics: Journal of the Royal Statistical Society, Series B, vol. 52, p. 105-124.
Elamir, E.A.H., and Seheult, A.H., 2003, Trimmed L-moments: Computational Statistics and Data Analysis, vol. 43, pp. 299–314.
theoLmoms
, par2qua
, TLmoms
, lmom.ub
para <- vec2par(c(0,1),type='nor') # standard normal TL00 <- theoTLmoms(para) # compute ordinary L-moments TL30 <- theoTLmoms(para,leftrim=3,rightrim=0) # trim 3 smallest samples # Lets look at the difference from simulation to theoretrical using # L-kurtosis and asymmetrical trimming for generalized Lambda dist. P <- vec2par(c(10000,10000,6,.4),type='gld') Lkurt <- TLmoms(quagld(runif(100),P),rightrim=3,leftrim=0)$ratios[4] theoLkurt <- theoTLmoms(P,rightrim=3,leftrim=0)$ratios[4] Lkurt - theoLkurt # as the number for runif goes up, this # difference goes to zero # Example using the Generalized Pareto Distribution # to verify computations from theoretical and sample stand point. n <- 100 # really a much larger sample should be used---for speed P <- vec2par(c(12,34,4),type='gpa') theoTL <- theoTLmoms(P,rightrim=2,leftrim=4) samTL <- TLmoms(quagpa(runif(n),P),rightrim=2,leftrim=4) del <- samTL$ratios[3] - theoTL$ratios[3] # if n is large difference # is small str(del)