Generate Recursive Dummy

For questions regarding programming in the EViews programming language.

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

kipfilet
Posts: 7
Joined: Wed Jul 08, 2009 7:12 am

Generate Recursive Dummy

Postby kipfilet » Thu Nov 19, 2009 7:04 pm

Hello all. I am working with a monthly time series workfile, and am trying to detect the specific date of a structural break in a regression. In order to achieve that, I have thought of generating a dummy and estimating the OLS regression n times. At the first iteration, the dummy would take value 1 from @first to @first+1 and 0 onwards. At the second iteration, it would take value 1 from @first to @first+2 and 0 onwards, and so on. Then, I would take the R-squared from each of the observations and would be able to detect at which date the structural break would take place (by seeing at which date the dummy would maximise the r-squared). This may seem a bit basic, but I am not very good at eviews programming. The program I have written so far is the following:

workfile taylor m 1999m01 2009m10

scalar itera=130
series(itera) rsqrdummy

!i=1
while !i<itera+1

smpl @first @first+3+!i
series dummy=1
smpl @first+3+!i @last
series dummy=0

equation eq02.ls eonia c infl_h indgap dummy

rsqrdummy(!i,1)=eq02.@rbar2

!i=!i+1
wend

But this yields a near singular matrix! What am I doing wrong? Thank you for your time.

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

Re: Generate Recursive Dummy

Postby trubador » Fri Nov 20, 2009 2:12 am

The following modified version might help:

Code: Select all

workfile taylor m 1999m01 2009m10 scalar itera=130 series(itera) rsqrdummy !i=1 while !i<itera-3 smpl @first @first+2+!i series dummy=1 smpl @first+3+!i @last series dummy=0 smpl @all equation eq02.ls eonia c infl_h indgap dummy rsqrdummy(!i,1)=eq02.@rbar2 !i=!i+1 wend


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests