Compute and draw the Mean Excess Function
E=mef(x)
On the data "x" (for instance asset returns), the function computes and draw the Mean Excess Function. It is the mean of the data exceeding a given threshold. Each value of ordered "x" is taken as a threshold.
First we generate 1000 normally daily returns on an asset with 0.1/250 mean and 0.2/sqrt(250) variance:
-->returns=grand(1000,1,'nor',0.1/250,0.2/sqrt(250));
Now we can use the function on these returns.
-->E=mef(returns);
The graph shows the values of the Mean Excess Function. For a normal random variable it is decreasing and convex.
Francesco Menoncin - Brescia University - 2010