Weibull
DistributionWeibull(scale: Tensor | float, concentration: Tensor | float, validate_args: bool | None = None)Weibull distribution — a flexible family for lifetime and survival analysis.
Weibull(scale=λ, concentration=k) generalises both the Exponential
() and Rayleigh () distributions. It is widely
used for modelling time-to-failure data because the hazard rate
can increase, be constant,
or decrease depending on .
Parameters
scaleTensor | floatconcentrationTensor | floatvalidate_argsbool | None= NoneTrue, validate parameter constraints at construction time.Attributes
Notes
PDF:
Log-PDF:
Moments:
- Mean:
- Variance:
Entropy:
where is the Euler–Mascheroni constant.
Reparameterised sampling uses the inverse-CDF: for .
Examples
>>> import lucid
>>> from lucid.distributions import Weibull
>>> # Exponential(rate=1) as a special case
>>> dist_exp = Weibull(scale=1.0, concentration=1.0)
>>> dist = Weibull(scale=2.0, concentration=1.5)
>>> samples = dist.rsample((500,))Used by 1
Constructors
1__init__
→None__init__(scale: Tensor | float, concentration: Tensor | float, validate_args: bool | None = None)Properties
3Mean of the Weibull distribution: .
Returns
TensorMean values of shape batch_shape.
Support of the Weibull distribution: .
Returns
ConstraintThe nonnegative constraint.
Instance methods
3Entropy of the Weibull distribution.
where is the Euler-Mascheroni constant.
Returns
TensorEntropy values of shape batch_shape (nats).
Draw reparameterised samples via the inverse-CDF.
Uses for
. Gradients propagate
through both scale and concentration.
Parameters
sample_shapetuple[int, ...]= ()Returns
TensorNon-negative samples of shape (*sample_shape, *batch_shape).