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
$$ \lambda^{(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.
As of version 1.5.2 of lmomco, there exists enhanced error trapping on integration failures in
theoTLmoms
. The function now abandons operations should any of the integrations for the \(r\)th L-moment fail for reasons such as divergent integral or round off problems. The function returns NAs for all L-moments in lambdas
and ratios
.
theoTLmoms(para, nmom=5, trim=NULL, leftrim=NULL, rightrim=NULL,
minF=0, maxF=1, quafunc=NULL,
nsim=50000, fold=5,
silent=TRUE, verbose=FALSE, ...)
An R
list
is returned.
Vector of the TL-moments. First element is \(\lambda^{(t_1,t_2)}_1\), second element is \(\lambda^{(t_1,t_2)}_2\), and so on.
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.
Level of symmetrical trimming used in the computation, which will equal NULL
if asymmetrical trimming was used.
Level of left-tail trimming used in the computation.
Level of right-tail trimming used in the computation.
Echo of the nsim
argument if and only if at least one Monte Carlo integration was required, otherwise this is set to “not needed” on the return.
Echo of the folds
argument if and only if at least one Monte Carlo integration was required, otherwise this is set to “not needed” on the return.
A logical vector of whether one or more Monte Carlo integrations was needed for the r
-th index of the vector during the integrations for the \(r\)-th L-moment.
An attribute identifying the computational source of the L-moments: “theoTLmoms” or switched to “theoLmoms” if this function was dispatched from theoLmoms
.
If verbose=TRUE
, then the results of the integrations are a data frame stored here. Otherwise, integrations
is not present in the list.
A distribution parameter object of this package such as by vec2par
.
The number of moments to compute. Default is 5.
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.
Level of trimming of the left-tail of the sample.
Level of trimming of the right-tail of the sample.
The end point of nonexceedance probability in which to perform the integration. Try setting to non-zero (but small) if you have a divergent integral.
The end point of nonexceedance probability in which to perform the integration. Try setting to non-unity (but close) if you have a divergent integral.
An optional and arbitrary quantile function that simply needs to except a nonexceedance probability and the parameter object in para
. This is a feature that permits computation of the L-moments of a quantile function that does not have to be implemented in the greater overhead hassles of the lmomco style. This feature might be useful for estimation of quantile function mixtures or those distributions not otherwise implemented in this package.
Simulation size for Monte Carlo integration is such is internally deemed necessary (see silent
argument).
The number of fractions or number of folds of nsim
, which in other words, means that nsim
is divided by folds
and a loop creating folds
integrations of nsim/folds
is used from which the mean and mean absolute error of the integrand are computed. This is to try to recover similar output as integrate()
.
The argument of silent
for the try()
operation wrapped on integrate()
. If set true and the integral is probability divergent, Monte Carlo integration is triggered using nsim
and folds
. The user would have to set verbose=TRUE
to then acquire the returned table in integrations
of the integration passes including those are or are not Monte Carlo.
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.
Additional arguments to pass.
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.
theoLmoms
, TLmoms
, tlmr2par