<< euler Financial module gbm >>

Financial module >> Financial module > evt

evt

Estimate the parameters of the Generalized Pareto Distribution with the Maximum Likelihood method

SYNOPSIS

[xoptim,v,inf]=evt(x0,x,u)

Description

For data (x) higher than a threshold "u", the Generalized Pareto Distribution have the form

f(x) = (1+xi*(x-u)/beta)^(-1/xi-1)/beta

This function estimates both "xi" and "beta" on the data (by Maximum Likelihood).

Parameters

x0
guess values used by the fsolve function for estimating the parameters "xi" and "beta" of the Generalized Pareto Distribution (Maximum Likelihood estimation)
x
vector containing the historical data; these can be, for instance, prices or returns
u
threshold above which the data are assumed to follow the Generalized Pareto Distribution

Output

xoptim
estimated values (with maximum likelihood) of parameters "xi" and "beta" of the Generalized Pareto Distribution
v
value of the gradient of the likelihood function (it should be as close as possible to zero)
inf
same meaning as "inf" in the "fsolve" function

Example

First we generate 1000 random numbers taken from a Generalized Pareto Distribution. First step is the creation of a vector of 1000 uniformly distributed random variables:

-->U=grand(1000,1,'def');

then we create the random variables from the GPD with parameters u=0.0001; xi=0.5; beta=0.00015:

-->x=0.0001-0.00015/0.5+0.00015/0.5*(1-U)^(-0.5);

These data could be daily return on an asset. Now we can use the function on vector x for computing ES and VaR at, for instance, 0.01 confidence level

-->[xoptim,v,inf]=evt([0.2 0.0002],x,0.0001)

inf = 1.

v = 1.0D-12 *

- 1.8189894 - 0.0017764

xoptim = 0.5020924 0.0001470

We can see that the convergence is good (please note that the algorithm is very sensitive to the initial condition x0). The estimated values of "xi" and "beta" are close to the true ones.

Authors

Francesco Menoncin - Brescia University - 2010

See Also


<< euler Financial module gbm >>