Extended path & bytecode

Hello Dynare folks,

Dynare 4.6.2 has been fixed with the bug for extended path simulations with the bytecode option.
However when I run an extended path simulation with the bytecode option, I get the following error:

Unable to resolve the name M_.params.

Error in extended_path_core (line 44)
    [flag, tmp] = bytecode('dynamic', endo_simul, exo_simul, M_.params,
    endo_simul, periods);

To solve the issue, line 44 of ep/extended_path_core, change ‘M_.params’ with ‘M.params’ when calling bytecode() function.

Kindly,
gauthier

Thanks for noticing and reporting this. This will be fixed in the next release.

Best,

Thank you Sebastien for your very quick reply.

I just figured out that the code feature two other issues. Running the code in its actual form (simple version of extended path with order=0 + lmmcp=1) provides the following error message:

Unable to perform assignment because dot indexing is not supported for
variables of this type.

Error in extended_path_core (line 82)
    [info_convergence, tmp] =
    extended_path_homotopy(endo_simul, exo_simul, M, options, oo, pfm,
    ep, order, algo, 2, debug);

tmp has been wrongly set line 44: ‘tmp’ is set as a matrix and is next called as a structure line 82.
I am not sure that ‘tmp’ needs to be set line 44 as it will stores the residual of the dynamic equations. So i would simply write line 44:
[info_convergence] = bytecode(…

With this typo solved, another error pops up:

Unrecognized function or variable 'info_convergence'.

Error in extended_path_core (line 80)
if ~info_convergence && ~options.no_homotopy

if the bytecode function returns flag=0 line 44, then ‘info_convergence’ is not set, so the code line 80 cannot work.

Kindly,
gauthier

Thanks for noticing this other problem.

The bug will be fixed in the next Dynare release. If you are impatient, you can try the changes contained in this commit: https://git.dynare.org/Dynare/dynare/-/commit/e012db29f5369dfe4c70656a969b16bdcb44e0cc

Best

1 Like

Thank you Sebastien it works perfectly!

Hello @sebastien

Just a quick question related to bytecode option with EP: is it possible to disable the messages when running an EP simulation? The message looks like:


MODEL SIMULATION: (method=Sparse LU)

  Simulate iteration no 1     
  max. error=2.4008185606e-02       
  sqr. error=7.4504184070e-04       
  abs. error=4.2973750031e-02       

I would like the code to run silently to only track the final output, not the intermediary one.

Kindly,
gauthier

Hi Gauthier,

I worked on this issue (removing useless outputs from bytecode solvers) years ago and I am not sure I finished… Since I decided not to use bytecode anymore (for extended path simulations). What are the values of options_.ep.debug and options_.ep.verbosity in your case?

Best,
Stéphane.

Hello Stéphane,

Thanks for your quick feedback.

Both options_.ep.debug and options_.ep.verbosity are set to zero, but thanks to your message I just figured out that’s actually options_.verbosity that controls the messaging from extended path. It works like a charm now.

Thanks again,
gauthier