Generalized Pareto distribution

The family of generalized Pareto distributions (GPD) has three parameters $$ \mu,\sigma \,$$ and $$ \xi \,$$.

The cumulative distribution function is


 * $$F_{(\xi,\mu,\sigma)}(x) = \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 \geqslant \mu $$ when $$ \xi \geqslant 0 \,$$, and $$ \mu \leqslant x \leqslant \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 \,$$.

The probability density function is:


 * $$f_{(\xi,\mu,\sigma)}(x) = \frac{1}{\sigma}\left(1 + \frac{\xi (x-\mu)}{\sigma}\right)^{\left(-\frac{1}{\xi} - 1\right)}.$$

or


 * $$f_{(\xi,\mu,\sigma)}(x) = \frac{\sigma^{\frac{1}{\xi}}}{\left(\sigma + \xi (x-\mu)\right)^{\frac{1}{\xi}+1}}.$$

again, for $$ x \geqslant \mu $$, and $$ x \leqslant \mu - \sigma /\xi $$ when $$ \xi < 0 \,$$.

Generating generalized Pareto random variables
If U is uniformly distributed on (0, 1 ], then


 * $$ X = \mu + \frac{\sigma (U^{-\xi}-1)}{\xi} \sim \mbox{GPD}(\mu,\sigma,\xi). $$

In Matlab Statistics Toolbox, you can easily use "gprnd" command to generate generalized Pareto random numbers.

With GNU R you can use the packages POT or evd with the "rgpd" command (see for exact usage: http://rss.acs.unt.edu/Rdoc/library/POT/html/simGPD.html)