How to re-use forecasted data

For questions regarding programming in the EViews programming language.

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

mokkeliner
Posts: 5
Joined: Mon Aug 04, 2014 6:48 am

How to re-use forecasted data

Postby mokkeliner » Tue Aug 05, 2014 1:27 am

I am trying to give stepwise exogenous shocks to my forecast, but when I try to forecast in steps, EViews simply forgets the previous forecast. I estimated a VECM (quarterly data from 1985:1 untill 2013:4) and when I try to solve it like this, it works just like it should:

model.scenario(c) "baseline"
smpl 2014:1 2024
model.solve(s=d)

However, the following alternative scenario does not seem to do what I want:

model.scenario(n,a=2) "alternative"

smpl 2014:1 2014:1
model.solve(s=d) first I solve for only one point ahead, the values of the variables in 2014:1 are the same as in the baseline scenario
genr s_sa=s_sa*0.98 here a shock is given to one of the variables, if run untill this line all variables have one extra data point, with one having a shock in 2014:1
smpl 2014:2 2015:1 Here, I set the working sample such that it can be solved up untill 2015:1. The idea is that it uses the previous forecast, including the shock, as the 2014:1 point
model.solve(s=d) Here, the program fails to solve the model, because the 2014:1 data points have disappeard and have become NA's
smpl 2015:1 2015:1
genr s_sa=s_sa*0.98
smpl 2015:2 2016:1
model.solve(s=d)
.
.
etc.
smpl @all


I think the idea of what I try to do is clear, but my understanding of EViews is not enough to get it to work. Does anyone here know how I can make this work? Help would be appreciated!

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

Re: How to re-use forecasted data

Postby EViews Gareth » Tue Aug 05, 2014 6:15 am

Is s_sa an endogenous or an exogenous variable?

mokkeliner
Posts: 5
Joined: Mon Aug 04, 2014 6:48 am

Re: How to re-use forecasted data

Postby mokkeliner » Tue Aug 05, 2014 7:43 am

Endogenous

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

Re: How to re-use forecasted data

Postby EViews Gareth » Tue Aug 05, 2014 7:50 am

I assume S is the actual variable, and S_SA is the scenario's version of that variable. Normally you would use overrides to do what you want, but you can only override an exogenous variable. You'll have to set S = S_SA for the periods before the solve.

mokkeliner
Posts: 5
Joined: Mon Aug 04, 2014 6:48 am

Re: How to re-use forecasted data

Postby mokkeliner » Tue Aug 05, 2014 8:18 am

s_sa is actually the seasonally adjusted variable (hence _sa)

The variable is called s_sa_0 and s_sa_1 in the scenario's. It seems that a command s_sa_1=..... (instead of s_sa=...) does not work either.

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

Re: How to re-use forecasted data

Postby EViews Gareth » Tue Aug 05, 2014 10:25 am

You'll have to post an example - it should work.

mokkeliner
Posts: 5
Joined: Mon Aug 04, 2014 6:48 am

Re: How to re-use forecasted data

Postby mokkeliner » Wed Aug 06, 2014 2:34 am

It seems that the following routine is working. Apparently I forgot to redefine each variable (in this model: i,u,p,bbp,s_sa,di) with the newly forecasted data. Thanks for your input Gareth.

(the scenario is labeled _2 instead of _1)

model.scenario(n,a=2) "alternative"
smpl 2014:1 2014:1
model.solve(s=d)
genr s_sa_2=s_sa_2*0.98
smpl @all
s_sa=s_sa_2
u=u_2
i=i_2
bbp=bbp_2
di=di_2
p=p_2
smpl 2014:2 2015:1
model.solve(s=d)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest