Sample Weibull⚠ unverified
General Calculations / Monte Carlo · Draw a sample from a Weibull distribution via inverse-transform sampling
Parameters
| Input | Symbol | Unit | Default | Description |
|---|---|---|---|---|
| shape | shape | k | 1.0 | Shape parameter (k) of the Weibull distribution |
| scale | scale | lambda | 1.0 | Scale parameter (lambda) of the Weibull distribution |
| Output | Symbol | Unit | Description |
|---|---|---|---|
| result | x | — | A single random sample from the Weibull distribution |
The science & history
Understanding the Parameters
-
Shape $\beta$ — controls the failure-rate character of the sampled lifetimes (Weibull Distribution PDF): $\beta < 1$ produces many early failures (infant mortality), $\beta = 1$ gives memoryless exponential lifetimes, $\beta > 1$ clusters failures around the characteristic life (wear-out). The same sampler thus generates any of the bathtub regimes.
-
Scale $\eta$ — the characteristic life, setting the timescale: samples are stretched so that about $63.2\%$ fall below $\eta$. Doubling $\eta$ doubles the typical sampled lifetime.
-
The uniform input $U$ — the internally-drawn random number on $(0,1)$. The inverse-CDF map turns its flat distribution into the skewed Weibull shape. When $\beta = 1$ the formula collapses to $x = -\eta\ln U$ — the standard exponential sampler.
-
The output $x$ — one random lifetime; over many draws the values reproduce the Weibull PDF with the chosen $\beta$, $\eta$. In system-reliability Monte Carlo, each component is sampled this way, the system life computed per trial, and the results aggregated into a life distribution.
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
-
The probability integral transform. The result that $F^{-1}(U)$ reproduces any distribution $F$ underlies nearly all variate generation; the Weibull is the textbook case where it is cleanest, needing only a logarithm and a power.
-
Monte Carlo reliability. Sampling component lifetimes and simulating system behaviour is the standard way to analyse complex reliability problems — redundancy, repair, spares, and mission success — that defeat analytic methods. Weibull sampling is the most common ingredient because Weibull (Weibull Reliability, Weibull Failure Rate) fits so much real life data.
-
From analytic to simulated. Where the reliability calculators elsewhere in this category give closed-form Weibull statistics (Weibull Mean, B10 Life), Monte Carlo Weibull sampling handles the cases those cannot — arbitrary system architectures, mixed distributions, and time-dependent logic.
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.