Page 1 of 1

if conditional by using loops outside the model

PostPosted: Fri Oct 26, 2012 7:44 pm
by mcastillo
Hello may you help me looking at this code. It is supposed to get the loop @#for pp in 0:1 in line 56, which it is being grabbed for the if conditional in lines 111 to 114.

i need to solve the model for these conditionals, but learning how to implement if condiitonal within model block but by using a loop from outside as in line 56. May you help me to figure it out please? :)

The error message is

Starting preprocessing of the model file ...
ERROR: There are 104 equations but 52 endogenous variables!


It’s like I'd have the double of equations but not, it is doubling the number of equations because there are two values 0 or 1 which enter into the conditional…what would be the error. How dynare it is not reading the @#for properly.

Re: if conditional by using loops outside the model

PostPosted: Mon Dec 03, 2012 2:05 pm
by SébastienVillemot
You cannot have two different models in the same MOD file. You should split this into 2 MOD-files (or maybe even 3, where a file contains all the factorized parts, and is @#include'd from the other 2).