Mixed distribution: Empirical body with Pareto tail.
This distribution combines an empirical distribution for the body (values below the mixing point) with a Pareto distribution for the tail (values at or above the mixing point).
The distribution is parameterized by:
- An empirical distribution of observed values
- A mixing point $m$ (threshold between body and tail)
- A Pareto shape parameter $\alpha$ (for the tail)
The CDF is continuous at the mixing point. Let $p_m = F_{\text{emp}}(m^-)$ be the empirical CDF just below the mixing point. Then:
- For $x < m$: $F(x) = F_{\text{emp}}(x)$
- For $x \ge m$: $F(x) = p_m + (1 - p_m) \cdot F_{\text{Pareto}}(x)$
where the Pareto distribution has scale = $m$ and shape = $\alpha$.
Value parameters
- empirical
-
The empirical distribution for the body
- mixingPoint
-
The threshold where we switch from empirical to Pareto tail
- paretoShape
-
The shape parameter (α) for the Pareto tail
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait HasInverseCdftrait HasCdf[Double]trait HasVariance[Double]trait HasMean[Double]trait ContinuousDistr[Double]trait Rand[Double]trait Density[Double]class Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Cumulative distribution function.
Cumulative distribution function.
For x < mixingPoint: F(x) = bodyWeight * (empirical CDF normalized to body) For x >= mixingPoint: F(x) = bodyWeight + tailWeight * F_Pareto(x)
Attributes
Draw a random sample from the mixed distribution
Draw a random sample from the mixed distribution
Attributes
Inverse CDF (quantile function)
Inverse CDF (quantile function)
Attributes
Log normalizer (distribution is already normalized)
Log normalizer (distribution is already normalized)
Attributes
Mean of the mixed distribution.
Mean of the mixed distribution.
E[X] = bodyWeight * E[X | X < m] + tailWeight * E[X_Pareto]
Note: For Pareto, mean is only defined when shape > 1.
Attributes
Plot the mixed distribution PDF/histogram.
Plot the mixed distribution PDF/histogram.
Attributes
As plot, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.
As plot, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.
Attributes
Plot the mixed CDF.
Plot the mixed CDF.
Attributes
As plotCdf, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.
As plotCdf, applying mods (e.g. Plots.fixedSize) to the spec after the built-in modifications.
Attributes
Probability that x < X <= y
Probability that x < X <= y
Attributes
Unnormalized log PDF.
Unnormalized log PDF.
For the body (empirical), this is technically undefined in the continuous sense since the empirical distribution is discrete. We return the log of the weighted probability mass if x exactly matches an empirical point, otherwise negative infinity.
For the tail (Pareto), we return the properly weighted log PDF.
Attributes
Variance of the mixed distribution.
Variance of the mixed distribution.
Uses the law of total variance.
Note: For Pareto, variance is only defined when shape > 2.
Attributes
Inherited methods
Returns the unnormalized value of the measure
Overridden by filter/map/flatmap for monadic invocations. Basically, rejection samplers will return None here
Overridden by filter/map/flatmap for monadic invocations. Basically, rejection samplers will return None here
Attributes
- Inherited from:
- Rand
Returns the log unnormalized value of the measure
Returns the log unnormalized value of the measure
Attributes
- Definition Classes
- Inherited from:
- ContinuousDistr
Attributes
- Inherited from:
- ContinuousDistr
Converts a random sampler of one type to a random sampler of another type. Examples: uniform.map(_2) gives a Rand[Double] in the range [0,2] Equivalently, for(x <- uniform) yield 2x
Converts a random sampler of one type to a random sampler of another type. Examples: uniform.map(_2) gives a Rand[Double] in the range [0,2] Equivalently, for(x <- uniform) yield 2x
Value parameters
- f
-
the transform to apply to the sampled value.
Attributes
- Inherited from:
- Rand
Returns the probability density function at that point.
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Gets n samples from the distribution.
Gets one sample from the distribution. Equivalent to get
Gets n samples from the distribution into a specified collection type.
Gets n samples from the distribution into a specified collection type.
Attributes
- Inherited from:
- Rand
An infinitely long iterator that samples repeatedly from the Rand
An infinitely long iterator that samples repeatedly from the Rand
Attributes
- Returns
-
an iterator that repeatedly samples
- Inherited from:
- Rand
Returns the probability density function up to a constant at that point.
Returns the probability density function up to a constant at that point.
Attributes
- Inherited from:
- ContinuousDistr
Attributes
- Inherited from:
- Rand
Inherited fields
Attributes
- Inherited from:
- ContinuousDistr