There is a newer version of the record available.

Published June 4, 2026 | Version v0.2.0
Software Open

thorek1/MacroModelling.jl: v0.2.0

  • 1. Imperial College London
  • 2. Washington University in St. Louis

Description

MacroModelling v0.2.0

Diff since v0.1.46

changelog: Major internal refactor and many new features

User-facing

Estimation, filtering, and smoothing

  • Filter-free joint loglikelihood estimation.
  • Missing-value support in estimation, filtering, and smoothing.
  • User-provided initial_state support in estimation.
  • Fixed a correctness issue in the second-order inversion filter.
  • Added warmup iterations to inversion-filter loglikelihood rrule.

Statistics, moments, and decompositions

  • Added higher-order (pruned 2nd/3rd) variance decomposition.
  • Added correlation to get_statistics, including derivatives.
  • Added marginal_contribution (Shapley) shock decomposition for the inversion filter and marginal_contribution variance decomposition at pruned 2nd/3rd order, using a polynomial-coefficient algorithm (∑_{j≤2k} C(nᵉ,j) Lyapunov solves) in place of the 2^nᵉ exhaustive coalition enumeration, making higher-order Shapley aggregation feasible for models with many shocks.

Solutions and IRFs

  • get_irf with parameters also works at higher order.

API, model writing, and Dynare interop

  • Custom steady-state function support (including in-place functions).
  • get_equations and get_calibration_equations accept a filter keyword argument.
  • write_mod_file (Dynare) allows modifying order, pruning, and IRF length.
  • Equation modification supported (Troll-style).
  • Counters for steady-state and perturbation solves.

Autodiff and ecosystem compatibility

  • All functions intended for use with derivatives now work with forward- and reverse-mode AD across all options (higher order, filters, etc.).
  • Compatibility with Mooncake (and switched the docs to Mooncake).
  • Compatibility with Turing <=0.45.

New models

  • Added the FRB/US model.

Internal

Performance and allocations

  • Overall greatly reduced allocations and improved performance.
  • Preallocated BLAS/LAPACK calls (QZ, LU, QR) throughout.
  • Preallocated workspaces for all solvers, with better reuse; uses LinearSolve and FastLapackInterface for matrix solves.
  • Many indices precomputed; constants moved to a separate struct; workspaces and caches reused across repeated solves.
  • AD paths of the doubling algorithms sped up by caching matrix powers.
  • Custom sparse-matrix kernel for higher-order solves.

Solutions and Solvers

  • Higher-order solution algorithms moved to compressed space (exploiting symmetry).
  • QME solver switches to doubling for large systems by default.
  • Analytical OBC Jacobian replaces ForwardDiff.
  • Bartels–Stewart Sylvester and Lyapunov solvers moved from MatrixEquations.jl to an extension.
  • Large Sylvester systems solved with Krylov methods now benefit from an ILU preconditioner.
  • Lyapunov solver: accepts an initial guess, supports early termination, better handles unstable systems, the Krylov solver now operates on the upper-triangular system (implicitly enforcing symmetry of the solution), and adds dqgmres support.
  • Lyapunov solver supports a has_unit_roots parameter for unit-root covariance handling.
  • Much more detailed tolerance settings across solvers, with more robust defaults.

Architecture and refactors

  • ForwardDiff is now an extension; internal derivatives use rrules based on analytical derivatives.
  • NSSS solver refactored: struct dissolved into constants, functions, caches, and workspaces; solve_nsss_wrapper introduced as the API layer.
  • DispatchDoctor type-stability coverage expanded across numerical source files.
  • Removed direct dependencies on RecursiveFactorization and DifferentiationInterface.
  • Equations are returned as expressions instead of strings.

Tests

  • System-prior estimation is now tested.
  • Replaced MCMCChains with FlexiChains in estimation tests.

Merged pull requests:

  • Filter autodocs to show only exported functions (#255) (@Copilot)
  • Optim_LFI_alloc (#262) (@thorek1)
  • new code space dev container (#274) (@thorek1)
  • refactor loglikelihood rrule conditions to simplify state updates; fi… (#275) (@thorek1)
  • Bump actions/upload-artifact from 6 to 7 (#276) (@dependabot[bot])
  • Bump julia-actions/cache from 2 to 3 (#282) (@dependabot[bot])
  • Bump codecov/codecov-action from 5 to 6 (#284) (@dependabot[bot])
  • Copilot/unit root covariance (#287) (@thorek1)
  • Higher order decompositions (#291) (@thorek1)
  • Cache squared matrices in doubling algorithms for AD speedup (#294) (@thorek1)
  • Filter with missing values (#295) (@thorek1)
  • Add filter-free estimation across all perturbation orders (#297) (@thorek1)
  • Warmup (#298) (@thorek1)

Files

thorek1/MacroModelling.jl-v0.2.0.zip

Files (15.7 MB)

Name Size Download all
md5:f3798fc74f5575240f799e6f866f6296
15.7 MB Preview Download

Additional details

Related works