Page 1 of 1

Using max(0,eqn) in model

Posted: Thu Jun 21, 2018 8:36 am
by brianleblanc
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?

Re: Using max(0,eqn) in model

Posted: Thu Jun 21, 2018 8:39 am
by EViews Gareth
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)