Estimate regularized, break- and gap-aware, quantile-decomposed nonlinear, instrumental-variable, and dynamic spatial panel ARDL models — with conformal forecasting, policy counterfactuals, rebound/spillover/displacement engines, and journal-ready graphics in your preferred language.
ssc install ardlflex, replace mata: mata mlib index ardlflex_demo
Exact methodological parity across Stata, Python, and R — same Elastic-Net EBIC tuning, gap-safe lag builder, Kelejian–Prucha spatial IVs, 3-standard combined effects, and conformal forecast bands.
ardlflex for Stata40 compiled Mata functions (lardlflex.mlib), full tsset/xtset integration, estat post-estimation suite, GUI dialog (db ardlflex), SMCL help files, and one-line net install directly from this hub.
ardlflex for PythonClean object-oriented ARDLFlex & ARDLFlexResult API built on NumPy, SciPy, Pandas, and Matplotlib. Full support for DataFrame workflows, journal-themed figures, and LaTeX/HTML/Markdown/CSV export.
ardlflex for RCRAN-ready S3 package (ardlflex(), summary(), predict()) built purely on base R + stats/graphics/grDevices — zero fragile dependencies, installs cleanly on any R 4.x system.
ardlflex One-of-a-KindEngineered from first principles to solve real-world econometric bottlenecks that conventional ARDL packages leave to manual workarounds.
Coordinate-descent Elastic Net with lag-decay adaptive weighting and EBIC auto-tuning (autopen) prevents lag overfitting while preserving unbiased long-run multipliers.
Decompose regressors into quartiles, quintiles, deciles, or custom cutpoints (qdecomp), with individual AIC/BIC lags and joint/pairwise LR & SR symmetry tests + ratios.
Unified panel engine supporting Dynamic Fixed Effects, Pooled Mean Group, Cross-Sectional Averages, and Spatial SLX/SAR/SDM with automatic Kelejian–Prucha IVs & Moran's I.
Seamless external (iv) and gap-safe internal lagged instruments (ivlags) with Post-Lasso instrument selection (ivmethod="lasso"), First-Stage F, Wu–Hausman, and Hansen J.
Dynamic forecasts with analytic, bootstrap, or conformal intervals — plus built-in standardized IPCC RCP2.6, RCP4.5, RCP6.0 & RCP8.5 pathways up to 2100 (standalone or extended from observed history).
Exact covariance variance decomposition (decompose), 8-state Tapio (2005) decoupling/coupling (decouple), cumulative policy AUC (policy), plus Rebound, Spillover, and MDR modules.
Bidirectional Reverse Causality Ratio (RCR), Oster (2019) OVB breakdown δ* (endog_audit), and Hybrid Nonlinear/Multi-Horizon/ECM Omnibus Causality (flex_causality) via Cauchy combination.
Screen heavy tails & asymmetry before NARDL/QARDL (shock_screen), and generate modern 90%/95% Dot-Whisker Forest plots (plot_coef) and named Panel Group-Comparison plots (plot_groups).
Configure your econometric specification below and toggle between Stata, Python, and R to generate ready-to-run estimation, diagnostics, forecasting, and publication export code.
Rendered with built-in journal themes (aer, nature, econometrica, bw) — available with identical plot types in Stata (ardlflex_plot), Python (plot_*), and R (ardlflex_plot()).
Stata: ardlflex_plot, type(fcast) steps(8) exog(drift) ci_method(conformal) style(aer)
Python: af.plot_fcast(fc, theme="aer") | R: ardlflex_plot(fc, "fcast", theme="aer")
Stata: ardlflex_plot, type(cf) nobreak horizon(10) reps(300) style(aer)
Python: af.plot_counterfactual(cf, theme="aer") | R: ardlflex_plot(cf, "counterfactual", theme="aer")
Stata: ardlflex_plot, type(regimes) var(clean_en) horizon(12) style(aer)
Python: af.plot_regimes(res, "clean_en", theme="aer") | R: ardlflex_plot(res, "regimes", var="clean_en", theme="aer")
Stata: ardlflex_plot, type(rebound) var(efficiency) bench(1.0) style(nature)
Python: af.plot_rebound(reb, theme="nature") | R: ardlflex_plot(reb, "rebound", theme="nature")
Stata: ardlflex_plot, type(displace) new(clean_en) old(fossil_en) style(nature)
Python: af.plot_displace(dis, theme="nature") | R: ardlflex_plot(dis, "displace", theme="nature")
Stata: ardlflex_plot, type(spillover) var(x1) horizon(10) style(aer)
Python: af.plot_spillover(spi, theme="aer") | R: ardlflex_plot(spi, "spillover", theme="aer")
Stata: ardlflex_coefplot, which(lr) export("fig_coef.pdf, replace")
Python: af.plot_coef([m1, m2], which="lr", theme="aer") | R: ardlflex_plot(list(m1, m2), "coef")
Stata: ardlflex_groupplot, var(mvalue) export("fig_groups.pdf, replace")
Python: af.plot_groups(m_dfe, var="mvalue", group_labels=names) | R: ardlflex_plot(m_dfe, "groups", group_labels=names)
Stata: ardlflex_decouple, var(ln_inc) growth(1.0)
Python: af.plot_decouple(dc, theme="nature") | R: ardlflex_plot(dc, "decouple", theme="nature")
Stata: ardlflex_rcp, rcp(rcp85) startyear(2025) steps(75)
Python: af.plot_rcp(rcps, history=(yrs, y), theme="nature") | R: ardlflex_plot(rcps, "rcp", history=list(x=yrs, y=y))
Copy-paste workflows for high-impact empirical research in energy, macroeconomics, and regional economics — switch seamlessly between Stata, Python, and R.
Developed by Samuel Asumadu Sarkodie, Ph.D., Ph.D. (Independent Researcher • asumadusarkodiesamuel@yahoo.com • ORCID: 0000-0001-5035-5983 • Zenodo DOI: 10.5281/zenodo.24721184).
@software{sarkodie2026ardlflex,
author = {Sarkodie, Samuel Asumadu},
title = {ardlflex: A Unified Cross-Language Suite for Regularized, Nonlinear, Instrumental-Variable, and Spatial ARDL Econometrics},
version = {1.0.0},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.24721184},
url = {https://doi.org/10.5281/zenodo.24721184}
}
Sarkodie, S. A. (2026). ardlflex: A Unified Cross-Language Suite for Regularized, Nonlinear, Instrumental-Variable, and Spatial ARDL Econometrics (Version 1.0.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.24721184