IF condition inside the model

For questions regarding programming in the EViews programming language.

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

jfgeli
Posts: 72
Joined: Fri Jan 30, 2009 6:29 pm

IF condition inside the model

Postby jfgeli » Wed Feb 26, 2014 8:50 am

Hi there,

I need to solve a simple model like a=b+c. I need to solve the model as of t+1 but for series b I want Eviews to use the original values (let's say until t+3 and then use a formula like b=a(-1)*0.5. The only way I could think of this is to solve the model with a loop for each t. First I calculate a and I use it to guess b (either the original values if I am in t+1 and t+2 or the formula based if we are in t+3 or forward).

t t+1 t+2 t+3 t+4 t+5
b 1 2 3 4
c 1 2 4 3 6 7 8

I want to solve from t+1 and t+5.

I hope I was clear enough :)

Cheers,

Fede

jfgeli
Posts: 72
Joined: Fri Jan 30, 2009 6:29 pm

Re: IF condition inside the model

Postby jfgeli » Wed Feb 26, 2014 8:53 am

Sorry, the most important question. Is it possible to ADD AN IF STATEMENT INSIDE A MODEL?
I have Eviews 7.29

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

Re: IF condition inside the model

Postby EViews Gareth » Wed Feb 26, 2014 9:07 am

You cannot use an if statement, but you can use the @recode function.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests