Using max(0,eqn) in model

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

brianleblanc
Posts: 3
Joined: Wed May 02, 2018 8:02 am

Using max(0,eqn) in model

Postby brianleblanc » Thu Jun 21, 2018 8:36 am

I have a number of equations I've estimated using OLS that I grouped into a model.

What I'm looking to do is to bound one of the equations below by zero in the model when doing simulations.

e.g.

equation EQN

EQN.ls X = c(1) + C(2)*Y

model MOD MAX(0,EQN)

That way, when I solve the model it overwrites the results in EQN with 0 if the output of EQN goes negative.

Any ideas how I would do that?

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

Re: Using max(0,eqn) in model

Postby EViews Gareth » Thu Jun 21, 2018 8:39 am

Break the link for that equation, so that it is in the model as text. Then add an @replace to the text to put in the condition.

X = @recode(c(1)+c(2)*y>0, c(1)+c(2)*y, 0)
Follow us on Twitter @IHSEViews


Return to “Models”

Who is online

Users browsing this forum: hychen and 1 guest