Page 1 of 1

Real Time BVAR

Posted: Thu Mar 05, 2015 2:27 pm
by cantagallo
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

Re: Real Time BVAR

Posted: Thu Mar 05, 2015 7:32 pm
by EViews Gareth
You're going to have to provide more details on what you're trying to do.

Re: Real Time BVAR

Posted: Fri Mar 06, 2015 8:44 am
by cantagallo
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

Re: Real Time BVAR

Posted: Fri Mar 06, 2015 8:54 am
by EViews Gareth
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?

Re: Real Time BVAR

Posted: Fri Mar 06, 2015 12:46 pm
by cantagallo
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.

Re: Real Time BVAR

Posted: Fri Mar 06, 2015 12:49 pm
by EViews Gareth
Which 6 variables?

Re: Real Time BVAR

Posted: Fri Mar 06, 2015 1:42 pm
by cantagallo
GDP Import Export GDP_deflator Import_deflator Export_deflator
for US China Italy