Second order approximation and the IRF explosive

Dear Prof. Jpfeifer,

Thanks for your help. I followed your shared post Optimal policy parameters in a non-linear model. I just modify a little bit since I only have two parameters which need to be optimized. However, when I run the mod-file, I get the error message:

Undefined function or variable ‘par_value_lambda’.

Error in welfare_objective (line 19)
outvalue=1e5+par_value_lambda^2;

Error in csminwel (line 62)
f0 = fcn(x0,varargin{:});

Error in housing (line 341)
[fhat,x_opt_hat] = csminwel(@welfare_objective,x_start,H0,[],crit,nit,x_opt_name);

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

Could you please help me check my code and see how to fix the problem? welfare_objective.m (703 Bytes)
housing.mod (7.2 KB)