class

Pareto

extendsDistribution
Pareto(scale: Tensor | float, alpha: Tensor | float, validate_args: bool | None = None)
source

Pareto distribution — a heavy-tailed power-law family on [xm,)[x_m, \infty).

Pareto(scale=x_m, alpha=α) models quantities that follow a power-law tail. The 80/20 rule (Pareto principle) is a heuristic consequence of this distribution with α1.16\alpha \approx 1.16.

Parameters

scaleTensor | float
Scale parameter xm>0x_m > 0 — the minimum possible value of the random variable (the lower bound of the support).
alphaTensor | float
Shape (tail-index) parameter α>0\alpha > 0. Smaller values produce heavier tails. The mean exists only for α>1\alpha > 1; the variance only for α>2\alpha > 2.
validate_argsbool | None= None
If True, validate parameter constraints at construction time.

Attributes

scaleTensor
Minimum value xmx_m.
alphaTensor
Tail index α\alpha.

Notes

PDF:

p(x;xm,α)=αxmαxα+1,xxmp(x; x_m, \alpha) = \frac{\alpha \, x_m^\alpha}{x^{\alpha+1}}, \quad x \geq x_m

Log-PDF:

logp(x)=logα+αlogxm(α+1)logx\log p(x) = \log\alpha + \alpha\log x_m - (\alpha+1)\log x

Moments (when defined):

  • Mean (α>1\alpha > 1): E[X]=αxm/(α1)E[X] = \alpha x_m / (\alpha - 1)
  • Variance (α>2\alpha > 2): Var[X]=xm2α/((α1)2(α2))\operatorname{Var}[X] = x_m^2 \alpha / ((\alpha-1)^2 (\alpha-2))

Entropy:

H[X]=log(xm/α)+1/α+1H[X] = \log(x_m / \alpha) + 1/\alpha + 1

Reparameterised sampling uses the inverse-CDF trick: if UUniform(0,1)U \sim \operatorname{Uniform}(0, 1) then X=xm(1U)1/αPareto(xm,α)X = x_m (1-U)^{-1/\alpha} \sim \operatorname{Pareto}(x_m, \alpha).

Examples

>>> import lucid
>>> from lucid.distributions import Pareto
>>> dist = Pareto(scale=1.0, alpha=2.0)
>>> samples = dist.rsample((200,))
>>> samples.min()  # always >= scale

Methods (7)

dunder

__init__

None
__init__(scale: Tensor | float, alpha: Tensor | float, validate_args: bool | None = None)
source

Initialise a Pareto distribution.

Parameters

scaleTensor | float
Scale parameter xm>0x_m > 0 — the minimum value of the support (lower bound of the distribution).
alphaTensor | float
Shape (tail-index) parameter α>0\alpha > 0. Smaller values produce heavier tails.
validate_argsbool | None= None
If True, validate parameter constraints at construction time.
prop

support

Constraint
support: Constraint
source

Support of the Pareto distribution: positive reals (0,)(0, \infty).

The true support is [xm,)[x_m, \infty) per element, but since the lower bound varies across the batch a bare positive constraint is returned.

Returns

Constraint

The positive constraint.

prop

mean

Tensor
mean: Tensor
source

Mean of the Pareto distribution: E[X]=αxm/(α1)E[X] = \alpha x_m / (\alpha - 1).

Defined only for α>1\alpha > 1; returns inf or nan for α1\alpha \leq 1.

Returns

Tensor

Mean values of shape batch_shape.

prop

variance

Tensor
variance: Tensor
source

Variance of the Pareto distribution.

Var[X]=xm2α/((α1)2(α2))\operatorname{Var}[X] = x_m^2 \alpha / ((\alpha-1)^2 (\alpha-2))

Defined only for α>2\alpha > 2.

Returns

Tensor

Variance values of shape batch_shape.

fn

rsample

Tensor
rsample(sample_shape: tuple[int, ...] = ())
source

Draw reparameterised samples via the inverse-CDF trick.

Uses X=xm(1U)1/αX = x_m (1 - U)^{-1/\alpha} where UUniform(0,1)U \sim \operatorname{Uniform}(0, 1). Gradients propagate through both scale and alpha.

Parameters

sample_shapetuple[int, ...]= ()
Leading shape of the output sample batch.

Returns

Tensor

Samples xm\geq x_m of shape (*sample_shape, *batch_shape).

fn

log_prob

Tensor
log_prob(value: Tensor)
source

Log-probability density of the Pareto distribution.

logp(x)=logα+αlogxm(α+1)logx\log p(x) = \log\alpha + \alpha\log x_m - (\alpha+1)\log x

Parameters

valueTensor
Points xxmx \geq x_m at which to evaluate the density.

Returns

Tensor

Log-density values of the same shape as value.

fn

entropy

Tensor
entropy()
source

Entropy of the Pareto distribution.

H[X]=log(xm/α)+1/α+1H[X] = \log(x_m / \alpha) + 1/\alpha + 1

Returns

Tensor

Entropy values of shape batch_shape (nats).