Learn R Programming

homtest (version 1.0-5)

Lmoments: Hosking and Wallis sample L-moments

Description

Lmoments provides the estimate of L-moments of a sample or regional L-moments of a region.

Usage

Lmoments (x) regionalLmoments (x,cod) LCV (x) LCA (x) Lkur (x)

Arguments

x
vector representing a data-sample (or data from many samples defined with cod in the case of regionalLmoments)
cod
array that defines the data subdivision among sites

Value

Lmoments gives the L-moments ($l1$, $l2$, $t$, $t3$, $t4$), regionalLmoments gives the regional weighted L-moments ($l1^R$, $l2^R$, $t^R$, $t3^R$, $t4^R$), LCV gives the coefficient of L-variation, LCA gives the L-skewness and Lkur gives the L-kurtosis of x.

Details

The estimation of L-moments is based on a sample of size $n$, arranged in ascending order. Let $x(1:n) <= x(2:n)="" <="..." be="" the="" ordered="" sample.="" an="" unbiased="" estimator="" of="" probability="" weighted="" moments="" $\betar$="" is:="" $$b_r="n^{-1}" \sum_{j="r+1}^n" \frac{(j-1)(j-2)\dots(j-r)}{(n-1)(n-2)\dots(n-r)}="" x_{j:n}$$<="" p="">

The sample L-moments are defined by: $$l_1 = b_0$$ $$l_2 = 2b_1 - b_0$$ $$l_3 = 6b_2 - 6b_1 + b_0$$ $$l_4 = 20b_3-30b_2+12b_1-b_0$$ and in general $$l_{r+1} = \sum_{k=0}^r \frac{(-1)^{r-k}(r+k)!}{(k!)^2(r-k)!} b_k$$ where $r=0, 1, ..., n-1$.

The sample L-moment ratios are defined by $$t_r=l_r/l_2$$ and the sample L-CV by $$t=l_2/l_1$$

Sample regional L-CV, L-skewness and L-kurtosis coefficients are defined as $$t^R = \frac{\sum_{i=1}^k n_i t^{(i)}}{ \sum_{i=1}^k n_i}$$ $$t_3^R =\frac{ \sum_{i=1}^k n_i t_3^{(i)}}{ \sum_{i=1}^k n_i}$$ $$t_4^R =\frac{ \sum_{i=1}^k n_i t_4^{(i)}}{\sum_{i=1}^k n_i}$$

References

Hosking, J.R.M. and Wallis, J.R. (1997) Regional Frequency Analysis: an approach based on L-moments, Cambridge University Press, Cambridge, UK.

See Also

mean, var, sd, HOMTESTS.

Examples

Run this code
x <- rnorm(30,10,2)
Lmoments(x)

data(annualflows)
annualflows
summary(annualflows)
x <- annualflows["dato"][,]
cod <- annualflows["cod"][,]
split(x,cod)
camp <- split(x,cod)$"45"
Lmoments(camp)
sapply(split(x,cod),Lmoments)

regionalLmoments(x,cod)

Run the code above in your browser using DataLab