I am sorry for the confusion, the shock stds were of course not supposed to be only scalars, that was a mistake. I adjusted the script and the mod file and it works much better. I am getting results for the first 18 periods, but then it fails on the nineteenth with this error:
Error using barrier
Gradient at initial point contains Inf, NaN, or complex values. Fmincon cannot continue.
Error in fmincon (line 834)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in dynare_minimize_objective (line 111)
fmincon(func,start_par_value,[],[],[],[],bounds(:,1),bounds(:,2),[],optim_options);
Error in osr.run (line 143)
[p, f] =
dynare_minimize_objective(str2func('osr.objective'),par_0,options_.osr.opt_algo,options_,M_.osr.param_bounds,M_.param_names(i_params),[],[],
M_,oo_,options_,i_params,...
Error in GSW_model.driver (line 1422)
[info, oo_, options_, M_] = osr.run(M_, options_, oo_,
var_list_,M_.osr.param_names,M_.osr.variable_indices,M_.osr.variable_weights);
Error in dynare (line 310)
evalin('base',[fname '.driver']);
Error in run (line 63)
dynare GSW_model.mod noclearall;
The rank condition is not verified either, so there must be something wrong going on but I don’t know what.
Here is the corrected file, which hopefully at least makes sense now:
Policy_Frontiers.rar (37.0 KB)
In summary, I iterate over the estimated parameters from the recursions and run OSR every time to get a policy frontier for each period.
At first, I thought that parameters had no effect on the frontier, hence my question, but I realize now that is not true, I just had a silly error in my code. As you said yourself, I had to change the values in the mod file.