Macro loop
Posted: Thu Mar 06, 2014 6:04 pm
Hey all: what I want to do is to (loop over) trigger the estimation command for a model where in each iteration I change a model equation (i.e. I have different cases of a model and I want to estimate them right after each other). I created seperate files, 1 for each case labelled "1.mod", "2.mod" ..., that only contain the one model specific equation.
Here is what I tried in my main file:
it tells me: ERROR in macro-processor: mainfile.mod:36.1: Could not open {case}.mod
the same happens if I try to loop over the whole code and not only the estimation cmd.
is this simply a syntax mistake or is my thinking wrong here?
Here is what I tried in my main file:
- Code: Select all
@#define cases = [ "1", "2",...]
VARIABLES BLOCK
PARAMETERS BLOCK
model(linear);
EQUATIONS THAT ARE THE SAME FOR ALL CASES
[b]@#include "{case}.mod" [/b] // to include the case specific equations
end;
VAROBS
ESTIMATED_PARAMS BLOCK
ESTIMATED_PARAMS_INIT BLOCK
@#for case in cases
ESTIMATION CMD
@#endfor
it tells me: ERROR in macro-processor: mainfile.mod:36.1: Could not open {case}.mod
the same happens if I try to loop over the whole code and not only the estimation cmd.
is this simply a syntax mistake or is my thinking wrong here?