Problem with using init_val file instead of steady state file

Dear all,

I am trying to solve a deterministic simulation model using alternative ways of specifying shocks. I initially used the shock block to specify the exogenous variables (n and pargamma) as follows:

initval;
n=0.0065;
pargamma=0.8180;
end;
steady;

endval;
n=-0.0121;
pargamma=0.9601;
end;

steady;

which dyanre solves perfectly using the default solver. However, once I start solving the model using an external init_val file that specifies the same process for the exogenous shocks, the default solver fails to converge and dynare solves the model using the homotopy method. The results from the two methods seem close enough, but I have trouble understanding the condition in which the default solver would fail and homotopy method would work.

I have uploaded my mod files below. Thank you all for your kind help.

deterministicsimul.mod (3.8 KB)
deterministicsimul_steadystate.m (6.1 KB)
initval_file_transition.m (10.1 KB)

Are you sure you are providing a correct terminal steady state in your initval-file? If you comment out
perfect_foresight_solver(maxit=100);
and compare the plots for the two cases, you will see that the conditions for the simulation are quite different.

Thank you so much for the help. That might be the problem. I’ll double-check on my code.