pwm.ub: Unbiased Sample Probability-Weighted Moments

pwm.ubR Documentation

Unbiased Sample Probability-Weighted Moments


Unbiased sample probability-weighted moments (PWMs) are computed from a sample. The β_r's are computed using

β_r = n^{-1} {n-1 \choose r}^{-1} ∑^n_{j=1} {j-1 \choose r} x_{j:n}\mbox{.}


pwm.ub(x, nmom=5, sort=TRUE)



A vector of data values.


Number of PWMs to return (r = nmom - 1).


Do the data need sorting? The computations require sorted data. This option is provided to optimize processing speed if presorted data already exists.


An R list is returned.


The PWMs. Note that convention is the have a β_0, but this is placed in the first index i=1 of the betas vector.


Source of the PWMs: “pwm.ub”.


Through a user inquiry, it came to the author's attention in May 2014 that some unrelated studies using PWMs in the earth-system sciences have published erroneous sample PWMs formula. Because lmomco is intended to be an authoritative source, here are some computations to further prove correctness with provenance:

"pwm.handbookhydrology" <- function(x, nmom=5) {
   x <- sort(x, decreasing = TRUE); n <- length(x); betas <- rep(NA, nmom)
   for(r in 0:(nmom-1)) {
      tmp <- sum(sapply(1:(n-r),
          function(j) { choose(n - j, r) * x[j] / choose(n - 1, r) }))
      betas[(r+1)] <- tmp/n

and a demonstration with alternative algebra in Stedinger and others (1993)

glo <- vec2par(c(123,1123,-.5), type="glo"); X <- rlmomco(100, glo)
lmom2pwm(lmoms(X, nmom=5))$betas # unbiased L-moments flipped to PWMs
[1]  998.7932 1134.0658 1046.4906  955.8872  879.3349
pwm.ub(X, nmom=5)$betas  # Hosking and Wallis (1997) and Asquith (2011)
[1]  998.7932 1134.0658 1046.4906  955.8872  879.3349
pwm.handbookhydrology(X) # ** alert reverse sort, opposite usually seen**
[1]  998.7932 1134.0658 1046.4906  955.8872  879.3349


W.H. Asquith


Asquith, W.H., 2011, Distributional analysis with L-moment statistics using the R environment for statistical computing: Createspace Independent Publishing Platform, ISBN 978–146350841–8.

Greenwood, J.A., Landwehr, J.M., Matalas, N.C., and Wallis, J.R., 1979, Probability weighted moments—Definition and relation to parameters of several distributions expressable in inverse form: Water Resources Research, v. 15, pp. 1,049–1,054.

Stedinger, J.R., Vogel, R.M., Foufoula-Georgiou, E., 1993, Frequency analysis of extreme events: in Handbook of Hydrology, ed. Maidment, D.R., McGraw-Hill, Section 18.6 Partial duration series, mixtures, and censored data, pp. 18.37–18.39.

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, v. 52, pp. 105–124.

See Also

pwm.pp, pwm.gev, pwm2lmom


pwm <- pwm.ub(rnorm(20))

lmomco documentation built on Aug. 27, 2022, 1:06 a.m.