## Class GeneralizedParetoDistribution

• java.lang.Object
• com.opengamma.strata.math.impl.statistics.distribution.GeneralizedParetoDistribution
• All Implemented Interfaces:
ProbabilityDistribution<Double>

public class GeneralizedParetoDistribution
extends Object
implements ProbabilityDistribution<Double>
Calculates the Pareto distribution.

The generalized Pareto distribution is a family of power law probability distributions with location parameter $\mu$, shape parameter $\xi$ and scale parameter $\sigma$, where $$\begin{eqnarray*} \mu&\in&\Re,\\ \xi&\in&\Re,\\ \sigma&>&0 \end{eqnarray*}$$ and with support $$\begin{eqnarray*} x\geq\mu\quad\quad\quad(\xi\geq 0)\\ \mu\leq x\leq\mu-\frac{\sigma}{\xi}\quad(\xi<0) \end{eqnarray*}$$ The cdf is given by: \begin{align*} F(z)&=1-\left(1 + \xi z\right)^{-\frac{1}{\xi}}\\ z&=\frac{x-\mu}{\sigma} \end{align*} and the pdf is given by: \begin{align*} f(z)&=\frac{\left(1+\xi z\right)^{-\left(\frac{1}{\xi} + 1\right)}}{\sigma}\\ z&=\frac{x-\mu}{\sigma} \end{align*} Given a uniform random number variable $U$ drawn from the interval $(0,1]$, a Pareto-distributed random variable with parameters $\mu$, $\sigma$ and $\xi$ is given by \begin{align*} X=\mu + \frac{\sigma\left(U^{-\xi}-1\right)}{\xi}\sim GPD(\mu,\sigma,\xi) \end{align*}

• ### Constructor Summary

Constructors
Constructor Description
GeneralizedParetoDistribution​(double mu, double sigma, double ksi)
Creates an instance.
GeneralizedParetoDistribution​(double mu, double sigma, double ksi, RandomEngine engine)
Creates an instance.
• ### Method Summary

All Methods
Modifier and Type Method Description
boolean equals​(Object obj)
double getCDF​(Double x)
Returns the cumulative distribution function for a value
double getInverseCDF​(Double p)
Given a probability, return the value that returns this cdf
double getKsi()
Gets the shape parameter.
double getMu()
Gets the location parameter.
double getPDF​(Double x)
Return the probability density function for a value
double getSigma()
Gets the scale parameter.
int hashCode()
double nextRandom()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### GeneralizedParetoDistribution

public GeneralizedParetoDistribution​(double mu,
double sigma,
double ksi)
Creates an instance.
Parameters:
mu - The location parameter
sigma - The scale parameter, not negative or zero
ksi - The shape parameter, not zero
• #### GeneralizedParetoDistribution

public GeneralizedParetoDistribution​(double mu,
double sigma,
double ksi,
RandomEngine engine)
Creates an instance.
Parameters:
mu - The location parameter
sigma - The scale parameter
ksi - The shape parameter
engine - A uniform random number generator, not null
• ### Method Detail

• #### getMu

public double getMu()
Gets the location parameter.
Returns:
The location parameter
• #### getSigma

public double getSigma()
Gets the scale parameter.
Returns:
The scale parameter
• #### getKsi

public double getKsi()
Gets the shape parameter.
Returns:
The shape parameter
• #### getCDF

public double getCDF​(Double x)
Returns the cumulative distribution function for a value
Specified by:
getCDF in interface ProbabilityDistribution<Double>
Parameters:
x - The value, not null
Returns:
The cdf
Throws:
IllegalArgumentException - If $x \not\in$ support
• #### getInverseCDF

public double getInverseCDF​(Double p)
Given a probability, return the value that returns this cdf
Specified by:
getInverseCDF in interface ProbabilityDistribution<Double>
Parameters:
p - The probability, not null. $0 \geq p \geq 1$
Returns:
Not supported
Throws:
UnsupportedOperationException - always
• #### getPDF

public double getPDF​(Double x)
Return the probability density function for a value
Specified by:
getPDF in interface ProbabilityDistribution<Double>
Parameters:
x - The value, not null
Returns:
The pdf
Throws:
IllegalArgumentException - If $x \not\in$ support
• #### nextRandom

public double nextRandom()
Specified by:
nextRandom in interface ProbabilityDistribution<Double>
Returns:
The next random number from this distribution
• #### hashCode

public int hashCode()
Overrides:
hashCode in class Object
• #### equals

public boolean equals​(Object obj)
Overrides:
equals in class Object