# pwm: Unbiased Sample Probability-Weighted Moments In lmomco: L-Moments, Censored L-Moments, Trimmed L-Moments, L-Comoments, and Many Distributions

## Description

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

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

## Usage

 `1` ```pwm(x, nmom=5, sort=TRUE) ```

## Arguments

 `x` A vector of data values. `nmom` Number of PWMs to return (r = `nmom - 1`). `sort` Do the data need sorting? The computations require sorted data. This option is provided to optimize processing speed if presorted data already exists.

## Value

An R `list` is returned.

 `betas` 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` Source of the PWMs: “pwm”.

W.H. Asquith

## References

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.

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.

`lmoms`, `pwm2lmom`, `pwm`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24``` ```# Data listed in Hosking (1995, table 29.2, p. 551) H <- c(3,4,5,6,6,7,8,8,9,9,9,10,10,11,11,11,13,13,13,13,13, 17,19,19,25,29,33,42,42,51.9999,52,52,52) # 51.9999 was really 52, but a real non censored data point. z <- pwmRC(H,52,checkbetas=TRUE) str(z) # Hosking(1995) reports that A-type L-moments for this sample are # lamA1=15.7 and lamAL-CV=.389, and lamAL-skew=.393 pwm2lmom(z\$Abetas) # WHA gets 15.666, 0.3959, and 0.4030 # See p. 553 of Hosking (1995) # Data listed in Hosking (1995, table 29.3, p. 553) D <- c(-2.982, -2.849, -2.546, -2.350, -1.983, -1.492, -1.443, -1.394, -1.386, -1.269, -1.195, -1.174, -0.854, -0.620, -0.576, -0.548, -0.247, -0.195, -0.056, -0.013, 0.006, 0.033, 0.037, 0.046, 0.084, 0.221, 0.245, 0.296) D <- c(D,rep(.2960001,40-28)) # 28 values, but Hosking mentions # 40 values in total z <- pwmRC(D,.2960001) # Hosking reports B-type L-moments for this sample are # lamB1 = -.516 and lamB2 = 0.523 pwm2lmom(z\$Bbetas) # WHA gets -.5162 and 0.5218 ```

### Example output

```Betas: 18.9696939393939 13.5880654356061 10.9387194159335 9.25512362292278 8.04940980289547
checkBbetas: 18.9696939393939 13.5880654356061 10.9387194159335 9.25512362292278 8.04940980289547
List of 8
\$ Abetas           : num [1:5] 15.67 10.93 8.74 7.41 6.49
\$ Bbetas           : num [1:5] 18.97 13.59 10.94 9.26 8.05
\$ source           : chr "pwmRC"
\$ threshold        : num 52
\$ zeta             : num 0.909
\$ numabovethreshold: int 3
\$ observedsize     : int 30
\$ samplesize       : int 33
\$lambdas
[1] 15.666663  6.202296  2.499668  1.513826  0.377672

\$ratios
[1]         NA 0.39589129 0.40302308 0.24407516 0.06089229

\$source
[1] "pwm2lmom"

\$lambdas
[1] -0.516299970  0.521805150 -0.191875497  0.025479444 -0.003476176

\$ratios
[1]           NA -1.010662754 -0.367714840  0.048829422 -0.006661828

\$source
[1] "pwm2lmom"
```

lmomco documentation built on Aug. 4, 2021, 9:06 a.m.