Postby gisi » Wed Nov 05, 2014 1:51 am
Dear Mr. Gareth,
I am so sorry to bother you, i am beginner with programming in Eviews..i just want to ask for your suggestion about how to plot the sequence of Chow statistics as a function of candidate break dates.. i was trying to follow your comments about that in some forums but it was unsuccessful..
the data is a monthly time series from March 1947 to April 2001..(650 observations)
the variable series01 is the growth rate of ratio of the Industrial Production index for manufacturing/durables to average weekly labor hours (Hansen's paper 2001)..is AR(1) process
the codes that I am using are below:
'Open a workfile
wfopen hol
smpl 1947m3 2001m4
'-----------------------------
%dep="" 'variable to store name of dependent variable
%regs= "c" ' variable to store list of regressors. Default is "c" for a constant
'%sample="@all" 'variable used to store sample. Default is "@all" for entire workfile
!doCovs=0 ' variable used to store choice of whether to display covariance options
!CovChoice=0' variable specify choice of covariance matrix.
!result=0 ' variable that will track the result of dialogs. -1indicates user hit cancel. 0 indicates user hit ok
%CovList="Default White HAC" ' list of covariance types for use in covariance dialog
%CovOpt="" 'cov option string
!result=@uidialog("edit",%dep,"Enter the dependent variable","edit",%regs,"Enter the list of regressors","edit", %sample,"Enter the equation sample","check",!doCovs,"View covariance options?") 'put up dialog
if !result=-1 then 'if user cancelled, then stop program
stop
endif
if !doCovs=1 then 'user indicates that wishes to view the covariance dialog, 0 otherwise
!result=@uilist(!CovChoice, "Covariance options", %CovList) 'put up dialog
if !result=-1 then
stop
endif
if !CovChoice =2 then
%CovOpt="cov=white"
else if !CovChoice =3 then
%CovOpt="cov=hac"
endif
endif
endif
'smpl{%sample} 'set the sample
'create a vector to store chow test
vector(54) chow
equation eq1.ls({%CovOpt}) {%dep} {%regs} 'estimate equation.
for !i=1947m3 to 2001m4 [THIS IS THE PROBLEM, is not well defined]
eq1.chow {!i}
next
'Chow test, the break date is known a priori
freeze(t1) eq1.chow 1973 'fail to find evidence of structural break(5% critical value from chi-squared distribution is 6)
freeze(t2) eq1.chow 1975 'exceeds 5% critical value, provides evidence of structural break.
'Andrews-Quandt TEST for unknown breakpoint, 15% trimming
freeze(QuandtAndrewstab) eq1.ubreak 15
'------------------------------
some trying in order to estimate breakpoints
'smpl 1947m1 1982m12
'equation eq1_1.ls series01 c series01(-1)
'smpl 1983m1 2001m4
'equation eq1_2.ls series01 c series01(-1)
'matrix wald= @transpose(@identity(eq1.@ncoef)*(eq1_1.@coefs-eq1_2.'@coefs))*@inverse(eq1_1.@cov/(eq1_1.@se)^2+eq1_2.@cov/(eq1_2.@se)^2)'*@identity(eq1.ncoef)*(eq1_1.@coefs -eq1_2.@coefs)
'wald= wald*(eq1.@regobs -2*eq1.@ncoef)/(eq1_1.@ssr +eq1_2.@ssr)
'Store coefficients into matrix
'colplace(coefmat,eq1_1@coefs)
'colplace(coefmat,eq1_2@coefs)
In the last part I was trying to estimate the break(unknown a priori) but i do not know how..
and additionally how can I construct a for loop for more than one break?
please kindly help me,
thank you very much in advance,
Best regards,