Learn R Programming

lmomco (version 2.4.14)

lmoms.cov: Distribution-Free Variance-Covariance Structure of Sample L-moments

Description

Compute the distribution-free, variance-covariance matrix (\(\widehat{\mathrm{var}}(\lambda)\)) of the sample L-moments (\(\hat\lambda_r\)) or alternatively the sample probability-weighted moments (\(\hat\beta_k\), Elamir and Seheult, 2004, sec. 5). The \(\widehat{\mathrm{var}}(\lambda)\) is defined by the matrix product

$$\widehat{\mathrm{var}}(\lambda) = \mathbf{C}\,\mathbf{\hat\Theta}\,\mathbf{C}^{\mathrm{T}}\mbox{,}$$

where the \(r \times r\) matrix \(\mathbf{C}\) for number of moments \(r\) represents the coefficients of the linear combinations converting \(\beta_k\) to \(\lambda_r\) and the \(r\)th row in the matrix is defined as

$$\mathbf{C}[r,]_{k{=}0:(r-1)} = (-1)^{(r-1-k)} {r-1 \choose k} {r-1+k \choose k}\mbox{,}$$

where the row is padded from the right with zeros for \(k < r\) to form the required lower triangular structure. Elamir and Seheult (2004) list the \(\mathbf{C}\) matrix for \(r = 4\).

Letting the falling factorial be defined (matching Elamir and Seheult's nomenclature) as $$a^{(b)} = \Gamma(b+1) {a \choose b}\mbox{,}$$ and letting an entry in the \(\mathbf{\hat\Theta}\) matrix denoted as \(\hat\theta_{kl}\) be defined as

$$\hat\theta_{kl} = \hat\beta_k\hat\beta_l - \frac{A}{n^{(k+l+2)}}\mbox{,}$$

where \(\hat\beta_k\) are again the sample probability-weighted moments and are computed by pwm, and finally \(A\) is defined as $$A = \sum_{i=1}^{n-1}\sum_{j=i+1}^{n} \bigl[ (i-1)^{(k)} (j-k-2)^{(l)} + (i-1)^{(l)} (i-l-2)^{(k)} \bigr] X_{i:n}X_{j:n}\mbox{,}$$ where \(X_{i:n}\) are the sample order statistics for a sample of size \(n\).

Incidentally, the matrix \(\mathbf{\hat\Theta}\) is the variance-covariance structure (\(\widehat{\mathrm{var}}\)) of the \(\hat\beta\), thus \(\widehat{\mathrm{var}}(\beta) = \mathbf{\hat\Theta}\), which can be returned by a logical function argument (as.pwm=TRUE) instead of \(\widehat{\mathrm{var}}(\lambda)\). The last example in Examples provides a demonstration.

Usage

lmoms.cov(x, nmom=5, as.pwm=FALSE, showC=FALSE,
             se=c("NA", "lamse", "lmrse", "pwmse"), ...)

Value

An R

matrix is returned. In small samples and substantially sized \(r\), one or more \(\hat\theta_{kl}\) will be NaN starting from the lower right corner of the matrix. The function does not test for this nor reduce the number of moments declared in nmom itself. To reiterate, the square roots along the \(\widehat{\mathrm{var}}(\lambda)\) diagonal are \(SE\) for the respective L-moments.

Arguments

x

A vector of data values.

nmom

The number of moments to compute. Default is 5.

as.pwm

A logical controlling whether the distribution-free, variance-covariance of sample probability-weighted moments (\(\mathbf{\hat\Theta}\)) is returned instead.

showC

A logical controlling whether the matrix \(\mathbf{C}\) is printed during function operation, and this matrix is not returned as a presumed safety feature.

se

Compute standard errors (\(SE\)) for the respective moments. The default of "NA" retains the return of either \(\widehat{\mathrm{var}}(\beta)\) or \(\widehat{\mathrm{var}}(\lambda)\) depending on setting of as.pwm. The "lamse" returns the square root of the diagonal of \(\widehat{\mathrm{var}}(\lambda)\), and notationally these are \(\lambda_r^{SE}\). Similarly, "pwmse" returns the square root of the diagonal of \(\widehat{\mathrm{var}}(\beta)\) by internally setting as.pwm to TRUE, and notationally these are \(\beta_{r-1}^{SE}\). (Remember that \(\beta_0 \equiv \lambda_1\)---the indexing of the former starts at 0 and at the later at 1). The "lmrse" returns the square root of the first two terms of the \(\widehat{\mathrm{var}}(\lambda)\) diagonal (\(\lambda_{1,2}^{SE}\)) but computes \(SE\) for the L-moment ratios (\(\tau_r^{SE}\)) for \(r \ge 3\) using the Taylor-series-based approximation (see Note) shown by Elamir and Seheult (2004, p. 348). (Remember that L-moment ratios are \(\tau_r = \lambda_r/\lambda_2\) for \(r \ge 3\) and that \(\tau_2 = \lambda_2/\lambda_1\) [coefficient of L-variation].)

...

Other arguments to pass should they be needed (none were at first implementation).

Author

W.H. Asquith

References

Elamir, E.A.H., and Seheult, A.H., 2004, Exact variance structure of sample L-moments: Journal of Statistical Planning and Inference, v. 124, pp. 337--359.

Karvanen, Juha, 2016, Lmoments---L-moments and quantile mixtures: R package version 1.2-3, accessed February 22, 2016 at https://cran.r-project.org/web/packages/Lmoments/index.html

See Also

lmoms, pwm