jessegrabowski / gEconpy

A collection of tools for working with DSGE models in python, inspired by the R package gEcon
https://geconpy.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
21 stars 4 forks source link

Numba accelerate functions generated by `SteadyStateSolver` #3

Closed jessegrabowski closed 1 year ago

jessegrabowski commented 1 year ago

SteadyStateSolver generates three sp.lambdify functions that need to be repeatedly called during estimation: f_ss, f_ss_resid, and f_jac_ss. These need to be wrapped with numba.njit for maximum performance during the estimation loop.

The function ss_func returned by SteadyStateSolver.solve_steady_state should also be jitted if possible. This will require some refactoring, as it uses SymbolDictionaries and calls the scipy.optimize.root function, neither of which are supported by numba.

If a complete analytic steady state is available, it should be easier to return a jitted function.

jessegrabowski commented 1 year ago

This was accidentally merged in together with #29, so I'm closing it. Bad bookkeeping!