tidyMacro
  • Home
  • Validation
  • Speed
  • FAQ
  • Pay It Forward
  • About
  1. Speed
  • Main
  • Short-run restrictions
  • Long-run restrictions
  • Mixed restrictions
  • External Instruments and Weak IV
  • Noninvertible shocks
  • Sign restrictions
  • Narrative restrictions
  • Sign restrictions and External instruments
  • Internal instruments
  • Heteroskedasticity
  • LP Primer
  • LP Syntax Primer
  • LP with Exogenous Shocks and IV
  • LP Nonlinear and State-Dependent
  • LP Panel
  • LP DID

Speed

tidyMacro against the reference MATLAB codes, same specifications, same thread budget

Every specification on the Validation page was timed in tidyMacro and in the MATLAB code it is compared with. The data, lag orders, horizons and draw counts are the same on both sides.

  • Thread budget. Both sides get 3 threads. tidyMacro receives n_threads = 3; MATLAB runs under maxNumCompThreads(3). The reference MATLAB codes have no parfor loops, so in MATLAB the budget only reaches multithreaded linear algebra.
  • Timing. Wall-clock time of one complete call, including VAR estimation. Each routine is run once untimed as a warm-up. Monte Carlo routines are then timed 3 times with different seeds and deterministic routines 20 times. The reported figure is the median.
  • Sign + external IV. The full Cesa-Bianchi and Sokol (2022) specification takes hours in the VAR Toolbox, so a lighter version is timed: one instrument (the monetary-policy surprise) instead of two, and the financial-shock signs imposed on impact only.
  • LP-DiD is not timed, because its reference is Stata output.
  • Machine. Intel Core i5-7360U (2 cores, 4 threads), macOS 13.6, MATLAB R2025b, R 4.6.0, tidyMacro 1.1.2.
Figure 1: Median wall-clock time per call, log scale. The label on the right of each row is the speed-up, MATLAB time divided by tidyMacro time.
Median seconds per call
Same data and specification on both sides; 3 threads each
Method Data Workload tidyMacro function MATLAB (s) tidyMacro (s) Speed-up
Monte Carlo
Sign + external IV (light) CBS2022 1,000 accepted draws, one IV, impact signs fSignRestr(instrument =) 17.8 0.288 62×
Sign + narrative ADRR2018 1,000 accepted draws, Volcker 1979m10 fSignRestr(narrative =) 54.7 1.02 53×
Long run (Blanchard-Quah) Gali1999 1,000 residual-bootstrap draws, h = 0-40 fVAR + fBootstrapBQ 7.97 0.152 52×
Sign restrictions Uhlig2005 1,000 accepted draws, signs over h = 0-5 fSignRestr 27.1 0.610 44×
Short run (Cholesky) Bloom2009 1,000 wild-bootstrap draws, h = 0-48 fVAR + fBootstrapChol 93.2 2.42 39×
External instrument (MBB) Kaenzig2021 2,000 moving-block draws, h = 0-48 fVAR + fBootstrapIVMBB 11.7 2.43 4.8×
Deterministic
LP-IV JordaTaylor2025IV h = 0-48 fLPIV 0.0344 0.0125 2.7×
LP, exogenous shock JordaTaylor2025 h = 0-17 fLP 0.00974 0.00500 1.9×
Panel LP MianSufiVerner2017 h = 0-6, two shocks fLPPanel 0.0202 0.0125 1.6×
External instrument (MSW) Kaenzig2021 Weak-IV robust bands, h = 0-48 fVAR + fMSW 0.450 0.545 0.83×
Back to top

© 2025 Muhsin Ciftci · Goethe University Frankfurt

 
  • Edit this page
  • Report an issue

This page is built with Quarto.