Hurst and R/S - V/S Programs

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

PERRYGOGAS
Posts: 36
Joined: Sat Nov 01, 2008 12:22 pm

Hurst and R/S - V/S Programs

Postby PERRYGOGAS » Sat Nov 01, 2008 12:32 pm

Hello all, does anybody know how I can find any programs for EVIEWS to
calculate Hurst Exponents and do R/S and V/S analysis?

Thank you!
Perry

PERRYGOGAS
Posts: 36
Joined: Sat Nov 01, 2008 12:22 pm

Re: Hurst and R/S - V/S Programs

Postby PERRYGOGAS » Wed Dec 10, 2008 8:34 pm

Any ideas here..?

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Hurst and R/S - V/S Programs

Postby trubador » Thu Dec 11, 2008 3:12 am

There is more than way to compute these exponents. First of all, you should decide which algorithm to use. As far as I know calculations do not require complex computations. Although it will be more difficult to write such syntax in EViews compared to other code driven software, you can still effectively program the steps of any algorithm in EViews.

In order to give you an idea, I've written the EViews program code below. It is actually a subroutine and all you have to do is enter the name of your series in the first line (i.e. call hurst(your_series)). The result is stored in coefficient named exponent. Original version of the code was previously written by somebody else in another programming language, and had no guarantee that it would work accurately. I tried to convert it into an EViews programming code. So try to build one of your own or use it at your own risk:

Code: Select all

call hurst(your_series)

subroutine hurst(series z)

!n = @obs(z)

stom(z,yh)
coef(1) exponent

vector yaxis = @filledvector(!n,0)
vector xaxis = @filledvector(!n,0)
vector y2 = @filledvector(!n,0)

!value = 0
!bin = 1

while !n>4
   !std = @stdev(yh)
   !value = !value+1
   yaxis(!value) = !std*!bin
   xaxis(!value) = !bin
   !n = @floor(!n/2)
   !bin = 2*!bin
      for !j =1 to !n
         y2(!j) = 0.5*(yh(2*!j)+yh((2*!j)-1))
      next
      delete yh
      vector(!n) yh
      for !k =1 to !n
         yh(!k) = y2(!k)   
      next
         
wend

vector yaxis2 = @subextract(yaxis,1,1,!value,1)
vector xaxis2 = @subextract(xaxis,1,1,!value,1)

mtos(yaxis2,yseries)
mtos(xaxis2,xseries)

equation fiteq.ls log(yseries) c log(xseries)
exponent(1) = fiteq.@coef(2)

delete y* x*

endsub


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 15 guests