Homotopy approach in Deterministic Simulation

Hello everyone,

I’m wondering if there is a way to directly compute a deterministic simulation with the perfect foresight solver using the homotopy approach. The manual explains that when Dynare fails to compute the simulation it switches to the homotopy approach and that we can freeze this option using no homotopy command. However, nothing is said about using the homotopy approach directly without waiting for Dynare’s iterations which I already know will fail.

Thank you.

Alex Crescentini.

No, that is not feasible, but you could hack the perfect_foresight_solver to get that behavior if really needed.

I need that just because there’s a little mistake in the dynamic of my model. Therefore, I need to do some trials and that command for sure will allow me to be faster instead of waiting each time for all the default iterations. Do you have some hints on how to hack the solver?

In perfect_foresight_solver.m around line 63 there is the part

oo_ = perfect_foresight_solver_core(M_,options_,oo_);

% If simulation failed try homotopy.
if ~oo_.deterministic_simulation.status && ~options_.no_homotopy

Instead of calling the solver with

oo_ = perfect_foresight_solver_core(M_,options_,oo_);

replace it by the outcome that the solution failed:

oo_.deterministic_simulation.status=0
1 Like

It worked. You helped me a lot.

Thank you, Johannes.