Looping over two parameters


#1

Dear Prof. Pfeifer,

I am trying to loop over two model parameters in the run.m file. Please see lines 86 to 110 in the run.m file of the attached folder. I want to generate welfare values for different combinations of values for phiP and alpha_P. Initially, I was looping over only 1 parameter ‘phiP’ and the model ran correctly. I am now trying to add another parameter ‘alpha_P’ (lines 87, 89, 91, 93 and 96) and I keep getting the following errors:

Warning: Variable ‘alpha_P’ not found.

In transition (line 834)
In dynare (line 223)
In run (line 85)
Undefined function or variable ‘phiP’.

Error in transition (line 835)
set_param_value(‘phiP’,phiP);

Error in dynare (line 223)
evalin(‘base’,fname) ;

Error in run (line 85)
dynare transition nostrict

If you run the run.m file which in turn runs transition.mod, you will see this error message. I have also introduced these parameters in lines 112-114 of the transition.mod file. I don’t know exactly where the problem is coming from. Could you please assist on how to loop over the two parameters in the run file so I can run the model for difference combinations of their values?

Many thanks in advance.

Dynare_loop.zip (1.0 MB)


#2

In your mod-file, you have

load phiP alpha_P

This command will try to load alpha_P from the file phiP.mat. But that is not what you want to do.