Skip to content
class

Pareto

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

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,x≥xmp(x; x_m, \alpha) = \frac{\alpha \, x_m^\alpha}{x^{\alpha+1}}, \quad x \geq x_m

Log-PDF:

log⁡p(x)=log⁡α+αlog⁡xm−(α+1)log⁡x\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 U∼Uniform⁡(0,1)U \sim \operatorname{Uniform}(0, 1) then X=xm(1−U)−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,))
>>> bool(samples.min() >= 1.0)  # always >= scale
True

Used by 2

Constructors

1
dunder

__init__

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

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.

Properties

4
prop

mean

→Tensor
mean: Tensor

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

mode

→Tensor
mode: Tensor

Mode of the Pareto distribution: the scale xmx_m, where the density is largest.

prop

support

→Constraint
support: Constraint

Support of the Pareto distribution: [xm,∞)[x_m, \infty).

Returns

Constraint

greater_than_eq(scale) — the bound is the scale tensor, so each batch member is held to its own xmx_m.

prop

variance

→Tensor
variance: Tensor

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.

Instance methods

6
fn

cdf

→Tensor
cdf(value: Tensor)

Cumulative distribution function of the Pareto distribution.

F(x)=1−(xmx)α,x≥xmF(x) = 1 - \left(\frac{x_m}{x}\right)^{\alpha}, \quad x \geq x_m

The Exponential(alpha) CDF at ln⁡(x/xm)\ln(x / x_m); 0 below xmx_m.

Returns probabilities in [0,1][0, 1].

Examples

>>> Pareto(scale=1.0, alpha=2.0).cdf(lucid.tensor(2.0))  # 1 - 1/4
tensor(0.75)
fn

entropy

→Tensor
entropy()

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).

fn

expand

→Self
expand(batch_shape: Sequence[int], _instance: Self | None = None)

Return a new Pareto with batch dimensions expanded to batch_shape.

fn

icdf

→Tensor
icdf(value: Tensor)

Quantile function of the Pareto distribution.

Q(p)=xm(1−p)−1/αQ(p) = x_m (1 - p)^{-1/\alpha}

Returns quantiles in [xm,∞][x_m, \infty].

Examples

>>> Pareto(scale=1.0, alpha=2.0).icdf(lucid.tensor(0.75))
tensor(2.)
fn

log_prob

→Tensor
log_prob(value: Tensor)

Log-probability density of the Pareto distribution.

log⁡p(x)=log⁡α+αlog⁡xm−(α+1)log⁡x\log p(x) = \log\alpha + \alpha\log x_m - (\alpha+1)\log x

Parameters

valueTensor
Points x≥xmx \geq x_m at which to evaluate the density.

Returns

Tensor

Log-density values of the same shape as value.

fn

rsample

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

Draw reparameterised samples via the inverse-CDF trick.

Uses X=xm(1−U)−1/αX = x_m (1 - U)^{-1/\alpha} where U∼Uniform⁡(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).