I know that this problem was broached on this forum many times since I found some topics connected with it but I didn't find any solution for my problem.
I want to look at some statistics of variables in the model when some parameters change. The steady state is calculated by hand and included in 'initval'. For creating the loop over parameters, I used simple syntax like this:
- Code: Select all
rhos = 0.8:0.05:1.05;
for i=1:length(rhos);
rho = rhos(i);
stoch_simul(order=1);
if info;
disp(['Computation fails for rho = ' num2str(rho)]);
end;
// results can be saved here
end;
This code with the loop above included is only working when I am looping over parameters that are not used for calculating steady state in the 'initval' part. Otherwise it gives me following error (though I included 'initval' part in the loop):
- Code: Select all
dynare:k_order_perturbation: Caught Kord exception: NaN or Inf asserted in first order derivatives in FirstOrder::solve
Error using mexErrCheck (line 41)
Error encountered in: k_order_perturbation.
Error in k_order_pert (line 40)
mexErrCheck('k_order_perturbation', err);
Error in stochastic_solvers (line 65)
[dr,info] = k_order_pert(dr,M_,options_,oo_);
Error in resol (line 118)
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);
Error in stoch_simul (line 76)
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
Error in b120813_1703_equity_premium_grid_search (line 407)
info = stoch_simul(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;
I would be thankful for any help.
Regards