Hand Calculations logo Hand Calculations All help pages ▾

Sample Weibull⚠ unverified

General Calculations / Monte Carlo · Draw a sample from a Weibull distribution via inverse-transform sampling

Parameters

InputSymbolUnitDefaultDescription
shapeshapek1.0Shape parameter (k) of the Weibull distribution
scalescalelambda1.0Scale parameter (lambda) of the Weibull distribution
OutputSymbolUnitDescription
resultxA single random sample from the Weibull distribution

The science & history

Understanding the Parameters

Derivation (Approaching a Proof)

Inverse-transform sampling works whenever a distribution's CDF can be inverted in closed form — and the Weibull's can. The Weibull CDF is

$$F(x) = 1 - e^{-(x/\eta)^\beta}.$$

Set it equal to a uniform draw and solve for $x$. Writing $U = F(x)$ (and using that $1 - U$ is also uniform on $(0,1)$, so we may substitute $U$ for $1-U$):

$$U = 1 - e^{-(x/\eta)^\beta} \;\Longrightarrow\; e^{-(x/\eta)^\beta} = 1 - U \;\Longrightarrow\; \left(\frac{x}{\eta}\right)^\beta = -\ln(1-U).$$

Taking the $\beta$-th root and replacing $1-U$ by $U$ (identically distributed) gives the sampler

$$x = \eta\,(-\ln U)^{1/\beta}. \qquad\blacksquare$$

The key fact making this exact is the probability integral transform: if $U$ is uniform on $(0,1)$, then $F^{-1}(U)$ has exactly the distribution $F$. The Weibull is a favourite example precisely because $F^{-1}$ is elementary — unlike the normal, which needs Box–Muller (Sample Normal).

Dimensional check. $U$ and $-\ln U$ are dimensionless; $\eta$ carries the time units, so $x = \eta(-\ln U)^{1/\beta}$ is a time. $\checkmark$

History and Development

Related Concepts: Weibull Distribution PDF, Weibull Reliability, Weibull Failure Rate, B10 Life, Sample Uniform, Sample Normal, Exponential Reliability

Notes: Registry calculator sample-weibull (unverified). Stochastic sampler — new random draw each call (not reproducible); use many draws. $x = \eta(-\ln U)^{1/\beta}$ is inverse-transform sampling of the Weibull CDF; $\beta=1$ reduces to the exponential sampler. Registry symbols k/lambda for $\beta$/$\eta$ with odd unit labels.

← Back to the workspace  ·  All help pages  ·  Getting started