weibull

mdhelper.fit.distribution.weibull(x: ndarray, a: float, b: float, c: float = 0) ndarray[source]

General three-parameter Weibull distribution.

\[y=ab(x-c)^{b-1}\exp{[-a(x-c)^b]}\]
Parameters:
xnumpy.ndarray

One-dimensional array containing \(x\)-values.

afloat

Scale parameter \(a\).

bfloat

Shape parameter \(b\). If specified to be a constant, the one-parameter Weibull distribution is used.

cfloat, keyword-only, default: 0

Location parameter \(c\). If not specified as a parameter, the two-parameter Weibull distribution is used.

Returns:
fitnumpy.ndarray

Fitted \(y\)-values.

Examples

Create a three-parameter Weibull distribution model for fitting.

>>> model = lambda x, a, b, c: weibull(x, a, b, c)

Create a two-parameter Weibull distribution model for fitting.

>>> model = lambda x, a, b: weibull(x, a, b)

Create a one-parameter Weibull distribution model for fitting, with \(b = 1\).

>>> model = lambda x, a: weibull(x, a, 1)