HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulestatistics-0.16.3.0Haskell2010

Statistics.Distribution.Weibull

The Weibull distribution. This is a continuous probability distribution that describes the occurrence of a single event whose probability changes over time, controlled by the shape parameter.

  • 1 type
  • 4 values
datadata WeibullDistribution
#

The Weibull distribution.

Instances19Eq, Data, Read, Show, Generic, Binary, …

Constructors

4 declarations

Create Weibull distribution from mean and standard deviation.

The algorithm is from "Methods for Estimating Wind Speed Frequency Distributions", C. G. Justus, W. R. Hargreaves, A. Mikhail, D. Graber, 1977. Given the identity:

(\frac{\sigma}{\mu})^2 = \frac{\Gamma(1+2/k)}{\Gamma(1+1/k)^2} - 1

k can be approximated by

k \approx (\frac{\sigma}{\mu})^{-1.086}

\lambda is then calculated straightforwardly via the identity

\lambda = \frac{\mu}{\Gamma(1+1/k)}

Numerically speaking, the approximation for k is accurate only within a certain range. We arbitrarily pick the range 0.033 \le \frac{\sigma}{\mu} \le 1.45 where it is good to ~6%, and will refuse to create a distribution outside of this range. The paper does not cover these details but it is straightforward to check them numerically.