Jorge Alonso-Ortiz

Jorge Alonso Ortiz

Research, teaching, opinions… and dogs

From Stata & Dynare

Task / EstimatorStataMATLAB / Dynarestatsmodels / linearmodelspuremacro
Cholesky SVARvar y1 y2, lags(1/4) + irf createvarm / VAR ToolboxVAR(Y).fit(4).irf(20)var.identify.cholesky_svar(Y, p=4, horizon=20)
Blanchard–Quah SVARsvar y1 y2, lreq(...)VAR Toolbox bq_svarSVAR(..., svar_type='B')var.identify.bq_svar(Y, p=4, horizon=20)
Sign RestrictionsUser pluginRubio-Ramírez / VAR Toolboxvar.identify.sign_restrictions(Y, restrictions={0: [+1, -1]}, p=4)
Proxy / External IV SVARsvarivMertens & Ravn SVAR-IVvar.identify.proxy_svar(Y, p=4, instrument_series=z)
Local Projections (HAC)jorda / manual OLSJordà (2005) codeOLS(y_h, X).fit(cov_type='HAC')lp.lp_hac(df, y="y", x="shock", horizon=20, lags=4)
State-Dep LP-IV (Ramey-Zubairy)manual 2SLS interactionlp.lp_state_dep_iv(df, y="y", x="g", z="news", state="u")
Panel LP (Driscoll–Kraay)xtsccPanel LP toolboxPanelOLS(..., cov_type='driscoll-kraay')lp.panel_lp_dk(df, y="y", x="z", unit_col="id", time_col="t")
Dynamic Panel GMMxtabond2 y L.y, gmm(y) two robustArellano–Bond MATLABdynpanel.ab_gmm(y, panel_id, time_id, two_step=True, windmeijer=True)
Staggered DiDcsdid y, ivar(id) time(t) gvar(g)did.callaway_santanna(df, unit="id", time="t", outcome="y", treat_time="g")
Synthetic DiDsdid y id t dsynthdid R packagedid.synthetic_did(df, unit="id", time="t", outcome="y", treat_time="g")
Factor-Augmented VAR (FAVAR)BBE (2005) MATLABvar.favar(panel_df, policy_series, n_factors=3, horizon=20)
Value Function IterationVFIToolkit ValueFnIter_Case1vfi.VFIProblem(a_grid, z_grid, P_z, return_fn, beta).solve()
Linear DSGE (QZ / BK)Dynare stoch_simul / Klein solabdsge.klein.klein_solve(A, B, C, n_pre=...)
DSGE from equations / .modDynare .mod filedsge.load_mod("rbc.mod") / dsge.build_dynare(eqs)
DSGE 2nd-Order PruningDynare stoch_simul(order=2, pruning)dsge.build_dynare(eqs, order=2) / m.solve_second_order()
puremacro-dynare CLIdynare model.mod command-linepuremacro-dynare model.mod --order 2 --fevd --plot
OccBin (ZLB / piecewise)Dynare occbin_solver / Guerrieri & Iacoviellodsge.solve_occbin(m_normal, m_zlb, constraint, shocks)
Non-Linear Perfect ForesightDynare simul (Boucekkine-Juillard)dsge.solve_perfect_foresight(m, shocks, T=100)
Bayesian DSGE (MCMC)Dynare estimation(...) (Metropolis-Hastings)dsge.estimate_dsge_bayesian(m, data, priors, n_draws=10000)
Sequence-Space Fake NewsSSJ (Auclert et al. 2021) Python/Juliamodels.fake_news_algorithm(T=40) / models.simulate_targeted_transfer(...)
GLS Unit Root (DF-GLS)dfgls y, maxlag(4)ERS (1996) codeadfullerunit_root.dfgls_test(y, regression="ct")
Seasonal Adjustmentx13 yX-13 wrapperSTL / x13sa.stl_sa(y) / sa.x11_sa(y)

Every puremacro call returns a result object with .summary(), .plot() and .to_latex(), so the last step to a paper table is one line.

Bring your Dynare model as it is

Pass a native .mod file, or its text, and solve it to second order with pruning.

from puremacro.dsge import load_mod

model = load_mod("rbc.mod")        # a path, or the .mod source text
sol = model.solve(order=2)         # 2nd-order pruned perturbation

print(sol.oo_dr["ghx"])            # Dynare-style decision rules
print(sol.theoretical_moments().to_latex())

Or from the terminal: puremacro-dynare model.mod --order 2 --fevd --plot