How to use fracdiff EViews add-in to perform the fractional Dickey-Fuller test

For posting your own programs to share with others

Moderators: EViews Gareth, EViews Moderator

bensalma
Posts: 2
Joined: Mon Nov 18, 2019 5:33 am

How to use fracdiff EViews add-in to perform the fractional Dickey-Fuller test

Postby bensalma » Sat May 08, 2021 8:54 am

Code: Select all

 

 ' With EViews 9
                                           
 'The objective of this program is to find the upper and the lower bound of the fractional integration parameter of an ARFIMA(0,d,0)
  'by using a sequential standard dickey-Fuller test, based on the usuels tabulated values.
                                           
 'This program is not flexible enough to use it in any situation (for example for d>=1). I am not an expert in programming.
  'But this program shows how efficient the sequential procedure is.
                                           
 'In this program we simulate a process ARFIMA(0,d,0) (For example d=0.6).
 'Then, we assume that (d) is unknown and we try to find an upper and lower bound for (d) by using a sequential procedure of the Dickey-Fuller test.
                                           
'Try to perform the program several time for a fixed value of d.
'Change the value of (d) (for example d=0.3, d=0.4, d=0.5) and perfom the program several time for each value.


create u 600
'---------------------------------------------------------
'Simulation of an ARFIMA(0,d,0) with d=0.6
'---------------------------------------------------------

genr e=nrnd
e.fracdiff(d=-0.6,)
rename e_diff x
genr y=x-@mean(x)
vector (10) Accept_Reject_H0 
'-------------------------------------------------------------
' Set of sequential values of (d0,i) and (d0,i-1)
'-------------------------------------------------------------
for !i=1 to 10
!d0=0.1*!i
!d=-1+0.1*!i
'------------------------------------------
'Compute xi(t)=(1-L)^(d0,i-1)y(t)
'------------------------------------------
y.fracdiff(d=!d, )
rename y_diff x!i
'------------------------------------------------------------------------------------
'Testing the null H0:d>=d0,i by means the t-stat of c(1)                         
'coefficient in the model (1-L)^(d0,i)y(t)=c(1)*(1-L)^(d0,i-1)y(t-1)
'------------------------------------------------------------------------------------
equation eq!i.ls d(x!i) x!i(-1)
if eq!i.@tstat(1)>-1.94 then Accept_Reject_H0(!i)=1 else Accept_Reject_H0(!i)=0
endif
delete x!i
next
'--------------------------------------------------------
'Find the lower and the upper bound of d
'--------------------------------------------------------
for !i= 1 to 9
if  Accept_Reject_H0(!i)=1  and Accept_Reject_H0(!i+1)=0 then
scalar Lower_bound_of_d=0.1*!i
scalar Upper_bound_of_d=0.1*(!i+1)
endif
next
'--------------------------------
' display results in table
'--------------------------------
table tab1
setcolwidth(tab1,1,20)
setcolwidth(tab1,4,20)

tab1(1,1)="Table 1"
tab1(2,1)= "Sequentiel F-DF test,"
tab1(3,1)="on the nile series: "
tab1(4,1)= " H0:d>=d0,i;  i=1 to 10"
tab1(4,2)=" "
tab1(4,3)=" "
tab1(4,4)=" "
tab1(4,5)=" "
setline(tab1,5)

tab1(9,1) = "d0,i"
tab1(9,2) = "d0,i-1"
tab1(7,3)= "DFt"
tab1(8,3)="="
tab1(9,3)="eq!i@tsat(1)"
tab1(7,4)="DF"
tab1(8,4)="distribution"
tab1(9,4)="cv(5%)"  'critical value of the Dickey-Fuller distribution
tab1(6,5)="Accept(=1)"
tab1(7,5)="or"
tab1(8,5)="Reject(=0)"
tab1(9,5)="H0"
setline(tab1,10)

tab1(11,1) = "0.1"
tab1(11,2) = "0.9"
tab1(11,3) = eq1.@tstat(1)
tab1(11,4)="-1.94"
tab1(11,5)=Accept_Reject_H0(1)
setline(tab1,12)

tab1(13,1) = "0.2"
tab1(13,2) = "0.8"
tab1(13,3) = eq2.@tstat(1)
tab1(13,4)="-1.94"
tab1(13,5)=Accept_Reject_H0(2)
setline(tab1,14)

tab1(15,1) = "0.3"
tab1(15,2) = "0.7"
tab1(15,3) = eq3.@tstat(1)
tab1(15,4)="-1.94"
tab1(15,5)=Accept_Reject_H0(3)
setline(tab1,16)

tab1(17,1) = "0.4"
tab1(17,2) = "0.6"
tab1(17,3) = eq4.@tstat(1)
tab1(17,4)="-1.94"
tab1(17,5)=Accept_Reject_H0(4)
setline(tab1,18)

tab1(19,1) = "0.5"
tab1(19,2) = "0.5"
tab1(19,3) = eq5.@tstat(1)
tab1(19,4)="-1.94"
tab1(19,5)=Accept_Reject_H0(5)
setline(tab1,20)

tab1(21,1) = "0.6"
tab1(21,2) = "0.4"
tab1(21,3) = eq6.@tstat(1)
tab1(21,4)="-1.94"
tab1(21,5)=Accept_Reject_H0(6)
setline(tab1,22)

tab1(23,1) = "0.7"
tab1(23,2) = "0.3"
tab1(23,3) = eq7.@tstat(1)
tab1(23,4)="-1.94"
tab1(23,5)=Accept_Reject_H0(7)
setline(tab1,24)

tab1(25,1) = "0.8"
tab1(25,2) = "0.2"
tab1(25,3) = eq8.@tstat(1)
tab1(25,4)="-1.94"
tab1(25,5)=Accept_Reject_H0(8)
setline(tab1,26)

tab1(27,1) = "0.9"
tab1(27,2) = "0.1"
tab1(27,3) = eq9.@tstat(1)
tab1(27,4)="-1.94"
tab1(27,5)=Accept_Reject_H0(9)
setline(tab1,28)

tab1(29,1) = "1"
tab1(29,2) = "0"
tab1(29,3) = eq10.@tstat(1)
tab1(29,4)="-1.94"
tab1(29,5)=Accept_Reject_H0(10)
setline(tab1,30)

tab1(2,4)="Lower bound of d="+@str(Lower_bound_of_d)
tab1(3,4)="Upper bound of d="+@str(Upper_bound_of_d)
tab1(4,4)=@str(Lower_bound_of_d)+"=<d<"+@str(Upper_bound_of_d)
show tab1

sequential_fdf_test.prg
Program EViews to perform a sequential fractional Dickey-Fuller test on the demeaned Nile series
(6.05 KiB) Downloaded 224 times
Hello Everyone
this is my first time participating in this forum. I want to share with EViews users how to use fracdiff Eviews add-in. I use fracdiff Eviews add-in, to perform the fractional Dickey-Fuller test. Here is the document link


https://mpra.ub.uni-muenchen.de/107445/ ... 107445.pdf
Attachments
nil_data.wf1
Nile series workfile
(20.9 KiB) Downloaded 196 times
Last edited by bensalma on Mon Jun 07, 2021 11:59 am, edited 2 times in total.



Return to “Program Repository”

Who is online

Users browsing this forum: No registered users and 16 guests