Real Time BVAR

For questions regarding programming in the EViews programming language.

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

cantagallo
Posts: 13
Joined: Wed Feb 25, 2015 4:02 am

Real Time BVAR

Postby cantagallo » Thu Mar 05, 2015 2:27 pm

Hi!
I'm running a real-time forecasting exercise with a BM model, using the AR as a benchmark. I'd like to expand the model adding a BVAR benchmark (Minnesota prior). I use Eviews7 and dowloaded the BVAR add-in but I don't know how to use it in a real-time context, in the programming code.
I copy what I've done for the AR (hoping that it's not too long): can someone please help me?

Code: Select all

!vqtr=1 for !v = 1 to 75 step 3 !vmth = 1 !vn = !v for %0 {%paese} call load_Qdata for %m1 %m2 "uni" "back" smpl 2005q4-!spanq+!vqtr 2005q4-1+!vqtr !tolav = 0.05 !tolin = 0.05 ' for %7 yar ddar mar xar pyar pdar pmar pxar equation eq_{%7}_{%0}.stepls(method={%m1}, {%m2}, btol={!tolin}, ftol={!tolav}) dlog({%7}_{%0}) c @ _ dlog({%7}_{%0}(-1)) dlog({%7}_{%0}(-2)) dlog({%7}_{%0}(-3)) dlog({%7}_{%0}(-4)) eq_{%7}_{%0}.ls next next smpl 2005q4-1+!vqtr+1 2005q4-1+!vqtr+!horizonq bm_{%0}.solve rename bm_{%0} v{!vqtr}_{!vmth}_bm_{%0} smpl @first 2005q4-1+!vqtr+!horizonq for %2 yar mar xar pyar pmar pxar genr v{!vqtr}_{!vmth}_{%2}_{%0} = {%2}_{%0}_0 delete {%2}_{%0} {%2}_{%0}_0 next ' ' this part computes the second and third month of the term !vmth = !vmth + 1 while !vmth<=3 !vn = !vn+1 smpl @all for %0 {%paese} 'HERE SAME CODE AS IN THE 1st LOOP !vmth = !vmth+1 wend !vqtr = !vqtr + 1 !vn=!vn+1 smpl @all next

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13585
Joined: Tue Sep 16, 2008 5:38 pm

Re: Real Time BVAR

Postby EViews Gareth » Thu Mar 05, 2015 7:32 pm

You're going to have to provide more details on what you're trying to do.

cantagallo
Posts: 13
Joined: Wed Feb 25, 2015 4:02 am

Re: Real Time BVAR

Postby cantagallo » Fri Mar 06, 2015 8:44 am

I think you're right, sorry.

If possible, I just need the programming code for the BVAR, equivalent to the AR part:

Code: Select all

for %m1 %m2 "uni" "back" smpl 2005q4-!spanq+!vqtr 2005q4-1+!vqtr !tolav = 0.05 !tolin = 0.05 ' for %7 yar ddar mar xar pyar pdar pmar pxar equation eq_{%7}_{%0}.stepls(method={%m1}, {%m2}, btol={!tolin}, ftol={!tolav}) dlog({%7}_{%0}) c @ _ dlog({%7}_{%0}(-1)) dlog({%7}_{%0}(-2)) dlog({%7}_{%0}(-3)) dlog({%7}_{%0}(-4)) eq_{%7}_{%0}.ls next

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13585
Joined: Tue Sep 16, 2008 5:38 pm

Re: Real Time BVAR

Postby EViews Gareth » Fri Mar 06, 2015 8:54 am

Still not clear.

From that code snippet it looks like you're using the built in stepwise least squares routine to select an appropriate lag distribution on the dependent variable for a simple linear least squares model.

What does that have to do with BVARs?

cantagallo
Posts: 13
Joined: Wed Feb 25, 2015 4:02 am

Re: Real Time BVAR

Postby cantagallo » Fri Mar 06, 2015 12:46 pm

I apologise again. That's right: I'd like to write a BVAR for the 6 variables (but with Eviews7, where only the add-in exists!) in the same position of my real-time code. Is it clearer? Sorry for that.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13585
Joined: Tue Sep 16, 2008 5:38 pm

Re: Real Time BVAR

Postby EViews Gareth » Fri Mar 06, 2015 12:49 pm

Which 6 variables?

cantagallo
Posts: 13
Joined: Wed Feb 25, 2015 4:02 am

Re: Real Time BVAR

Postby cantagallo » Fri Mar 06, 2015 1:42 pm

GDP Import Export GDP_deflator Import_deflator Export_deflator
for US China Italy


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests