Skip to contents

Mean, variance (definition and computational forms cross-checked) and standard deviation. Mirrors morie.fn ...3e19/3e34/3e35/5e31.

Usage

morie_pmf_moments(values, probs)

Arguments

values, probs

the pmf; probs must sum to 1.

Value

list(mean, variance, sd).

References

Morin (2016), eqs. (3.19), (3.34)-(3.35), (5.31).

Examples

morie_pmf_moments(1:6, rep(1 / 6, 6))$variance
#> [1] 2.916667