Welfare comparison With lambda_utility

Hi everyone,
I am trying to compare and Monetary policy , fiscal policy and environmental policy in an NK model using the standard consumption-equivalent measure. I found the mod file for Born and Pfeifer (2018) and have been working to replicate it. I have attached my files below. I get the following errors when I try to calculate lamda_utility using the solver:

Error using feval
Undefined function ‘get_consumption_equivalent_unconditional_welfare’ for input arguments of type ‘struct’.

Error in csolve (line 62)

Error in ED.driver (line 1983)

Error in dynare (line 310)
evalin(‘base’,[fname ‘.driver’]);

I tried to search up on what these errors mean but it’s still not very clear to me. I have attached the updated mod file and m file. Could you please take another look and suggest on what I should try next? Thank you!
ED.mod (7.9 KB)
get_consumption_equivalent_conditional_welfare.m (2.7 KB)

get_consumption_equivalent_unconditional_welfare is a MATLAB function file and this name is an input in your \texttt{csolve } function.

I think that get_consumption_equivalent_unconditional_welfare may not be normal input parameter in csolve function as I know.

Although Professor Pfiefer may help better in this case.


I don’t really understand what you try to achieve here, but clearly you are missing a file. You should download this one from @jpfeifer repository:

Also there is a typo in the list of endogenous variables. Dynare is case sensitive, you have to replace Welfare_Gap (in your mod file) by Welfare_gap (which is expected by the matlab routine).

On my laptop the code is crashing because of the hundreds of generated plots (java error), I had to use the option nograph in stoch_simul.


1 Like

Thank you Professor Stephen for your reply, the problem is solved