Page 1 of 1

compute Hill's estimate

Posted: Sat Oct 31, 2015 6:34 pm
by gka
Hello guys do you know how I compute Hill's estimate?

The routine bellow does not work and I can not find why...

Code: Select all

' compute Hill's estimate subroutine local hill(scalar hill, series x, scalar m) ' get indices stom(x, xvec) vector xranks= @ranks(xvec) vector m vector xtemp ' get first m observations of sorted data vector(m)=xtemp xtemp = 0 for !i=1 to m xtemp(xranks(!i)) = xvec(!i) next ' find m-th point !xm = xtemp(m) ' find mean of first m-1 points !xsum = @sum(xtemp) - !xm !mean = !xsum / (m - 1) ' compute hill hill = !mean - !xm endsub

Re: compute Hill's estimate

Posted: Sun Nov 01, 2015 9:57 pm
by gka
Nobody?

Re: compute Hill's estimate

Posted: Mon Nov 02, 2015 10:49 am
by EViews Glenn
What are you trying to do?

Re: compute Hill's estimate

Posted: Mon Nov 02, 2015 2:00 pm
by gka
wach the link below:
http://www.utstat.utoronto.ca/keith/pap ... sthill.pdf (see Introduction 1), Hille estimator, in finance, modeling the
tails of the distribution of returns is important in the evaluation of risk (Embrechts et al.,1997; Brooks et al., 2005).. I find the routine in phoroum but does not work, I want to estimate the hill parametr with eviews because if I estimate it, in another software i must rewrite the total routine again.

Re: compute Hill's estimate

Posted: Mon Nov 02, 2015 6:06 pm
by EViews Glenn
Normally don't read papers for the purposes of answering forum questions, but it looked like it would be easy so I took a quick look. I only glanced at the first bit, but if I'm understanding correctly, something like

Code: Select all

!k = 30 series rnks = @ranks(cons, "d") smpl if rnks = !k+1 scalar scale = @mean(cons) smpl if rnks <= !k scalar alpha = 1 / @mean(@log(cons)-log(scale))
should do the trick for k=30.

First line ranks all of the observations in the series (in my case CONS) in descending order.
Next two lines compute the value of the series for the !k+1 rank.
Last two lines restrict sample to the first k descending order statistics, and compute the mean of the log of the scaled data.

Note that as with many things in EViews, you are far better trying to do things using series generation which allows you to avoid loops.

Hope this answers the question.

Re: compute Hill's estimate

Posted: Tue Nov 03, 2015 6:42 am
by gka
Thanks, I will try and I will tell you the results...

Re: compute Hill's estimate

Posted: Sun Dec 13, 2015 5:35 am
by Lixir