Automatic normalization of variables when solving a model with multiple trends
Trying to simulate the latest backward-looking version of the FR-BDF model with perfect_foresight_solver (as we did before) seems to have raised a conflict between the precision criteria (tolf) and the simulation horizon. We raised the precision criteria to 1e-9 to get a better comparison with Troll simulations with a previous version of the model, with no impact on the simulation horizon length (we used to simulate up to 2300Q4, roughly 1130 periods).
Updating the model to its latest version (the main difference with the former version being the integration of block related to financing of firms), we can no longer simulate further than 2050Q4 (128 periods) with tolf at 1e-9, lowering the precision criteria to 1e-5 (its default value), we’re able to simulate up to but no further than 2083Q4 (about 260 periods).
Checking the equation’s numerical residuals against the ones obtained in Troll (using dynamic_resid.m and feeding it manually constructed inputs), we are confident the issue does not come from a parsing error (translation from Troll syntax to Dynare).
Our main hypothesis tends to focus on the fact that the values of variables vary widely from variable to variable, with growing discrepancies in simulations related to multiple steady-state growth rates of the model. Mixing very small quantities with very big ones could cause issues in the numerical methods used to solve the model. Operating some automatic normalization when solving the model could solve this aspect. The way to operate such a rebalancing and the degree of generality of the algorithm (only for backward-looking models or also for forward-looking ones) will be specified after a discussion with Stéphane Adjemian.