# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.evt.evd.univariate

## Class GeneralizedParetoDistribution

• java.lang.Object
• com.numericalmethod.suanshu.stats.evt.evd.univariate.GeneralizedParetoDistribution
• All Implemented Interfaces:
ProbabilityDistribution, UnivariateEVD

public class GeneralizedParetoDistribution
extends Object
implements UnivariateEVD
Generalized Pareto distribution (GPD) is used for modeling exceedances over (or shortfalls below) a threshold. The cumulative distribution function is $F(x; \mu,\sigma,\xi) = \begin{cases} 1 - \left(1+ \frac{\xi(x-\mu)}{\sigma}\right)^{-1/\xi} & \text{for} \; \xi \neq 0, \\ 1 - \exp \left(-\frac{x-\mu}{\sigma}\right) & \text{for} \; \xi = 0. \end{cases}$ for $$x \ge \mu$$ when $$\xi \ge 0$$, and $$\mu \le x \le \mu - \sigma /\xi$$ when $$\xi <0$$, where $$\mu\in\mathbb R$$ is the location parameter, $$\sigma>0$$ the scale parameter and $$\xi\in\mathbb R$$ the shape parameter. Note that some references give the "shape parameter" as $$\kappa=-\xi$$.
Wikipedia: Generalized Pareto distribution, Wikipedia: Pickands-Balkema-de Haan theorem
• ### Constructor Summary

Constructors
Constructor and Description
GeneralizedParetoDistribution()
Create an instance with the default parameter values: location $$\mu=0$$, scale $$\sigma=1$$, shape $$\xi=0$$.
GeneralizedParetoDistribution(double scale, double shape)
Create an instance with zero location, and the given scale and shape parameters.
GeneralizedParetoDistribution(double location, double scale, double shape)
Create an instance with the given parameter values.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double cdf(double x)
Gets the cumulative probability F(x) = Pr(X ≤ x).
double density(double x)
The probability density function $f(x; \mu,\sigma,\xi) = \begin{cases} \frac{1}{\sigma}\left(1+ \frac{\xi (x-\mu)}{\sigma}\right)^{\left(-\frac{1}{\xi} - 1\right)} & \text{for} \; \xi \neq 0, \\ \frac{1}{\sigma}\exp \left(-\frac{x-\mu}{\sigma}\right) & \text{for} \; \xi = 0 \end{cases}$ for $$x \ge \mu$$ when $$\xi \ge 0$$, and $$\mu \le x \le \mu - \sigma /\xi$$ when $$\xi <0$$.
double entropy()
Gets the entropy of this distribution.
double kurtosis()
Gets the excess kurtosis of this distribution.
double logDensity(double x)
Get the logarithm of the probability density function at $$x$$, that is, $$\log(f(x))$$.
double mean()
$\mu + \frac{\sigma}{1-\xi}$ for $$\xi < 1$$.
double median()
$\mu + \frac{\sigma( 2^{\xi} -1)}{\xi}$
double moment(double x)
The moment generating function is the expected value of etX.
double quantile(double p)
Gets the quantile, the inverse of the cumulative distribution function.
double skew()
Gets the skewness of this distribution.
double variance()
$\frac{\sigma^2}{(1-\xi)^2(1-2\xi)}$ for $$\xi < 1/2$$.
• ### Constructor Detail

• #### GeneralizedParetoDistribution

public GeneralizedParetoDistribution()
Create an instance with the default parameter values: location $$\mu=0$$, scale $$\sigma=1$$, shape $$\xi=0$$.
• #### GeneralizedParetoDistribution

public GeneralizedParetoDistribution(double scale,
double shape)
Create an instance with zero location, and the given scale and shape parameters. If GPD is used to model exceedances over a threshold, location is usually set to zero (i.e., location is at the threshold).
Parameters:
scale - the scale parameter $$\sigma$$
shape - the shape parameter $$\xi$$
• #### GeneralizedParetoDistribution

public GeneralizedParetoDistribution(double location,
double scale,
double shape)
Create an instance with the given parameter values.
Parameters:
location - the location parameter $$\mu$$
scale - the scale parameter $$\sigma$$
shape - the shape parameter $$\xi$$