LevyDistribution
Represents the Levy distribution, a heavy-tailed, right-skewed continuous probability distribution supported on [mu, +infinity).
The Levy distribution is one of only three stable distributions whose probability density has a closed-form expression (the other two being the normal and Cauchy distributions). It arises naturally in physics as the distribution of first-passage times of Brownian motion and is used in finance to model heavy-tailed phenomena such as extreme market movements.
The distribution is parameterized by a location parameter mu and a scale parameter c. Because the tails are extremely heavy, the mean and variance are both infinite, and the skewness and excess kurtosis are undefined (returned as Double.NaN).
The CDF and survival function are expressed in terms of the complementary error function and error function respectively, and the quantile function uses the inverse complementary error function, so no iterative root-finding is needed.
Example:
val levy = LevyDistribution(mu = 0.0, c = 1.0)
levy.mean // Infinity
levy.variance // Infinity
levy.pdf(1.0) // 0.2420 (density at x = 1)
levy.cdf(2.0) // 0.4795
levy.quantile(0.5) // 2.1981 (the median)
levy.sample(Random(42)) // a single random draw from Levy(0, 1)
// Standard Levy distribution (mu=0, c=1)
val std = LevyDistribution.STANDARD
std.cdf(1.0) // 0.3173Types
Properties
Returns Double.NaN because the excess kurtosis of the Levy distribution is undefined.
Returns Double.POSITIVE_INFINITY because the Levy distribution has infinite mean.
Returns Double.NaN because the skewness of the Levy distribution is undefined.
Returns Double.POSITIVE_INFINITY because the Levy distribution has infinite variance.