📦 New package: EconCausal – Advanced causal inference for time series with temporal stability validation

The EconCausal package provides a comprehensive suite of three complementary econometric methodologies specifically designed for causal inference in time series data, with particular emphasis on temporal stability validation. The central innovation is implementing sophisticated analytical frameworks that determine directional relationships between economic variables while rigorously testing whether these relationships persist across different temporal regimes—a critical requirement often overlooked in traditional econometric analysis.

In practical terms, you often need to establish not just correlation but genuine causality between economic variables over time, while ensuring your findings aren't artifacts of specific time periods. The challenge is: How do you reliably identify causal relationships that remain stable across economic cycles, policy changes, and structural breaks?

The main functionality of EconCausal includes:

  • Error Correction Models with MARS Enhancement (ECM-MARS): Hybrid approach combining classical cointegration analysis with non-parametric regression to capture nonlinear adjustment mechanisms and threshold effects

  • Bayesian Structural Time Series (BSTS): State-space modeling with automatic variable selection via spike-and-slab priors and full Bayesian uncertainty quantification

  • Bayesian GLM with AR(1) Errors: Complete Bayesian inference for autoregressive models with dual evaluation criteria requiring simultaneous improvement in both predictive density and forecast accuracy

  • Comprehensive temporal validation through Leave-Future-Out cross-validation with stringent stability criteria

  • Multi-level parallelization for efficient computation across pairwise comparisons and within-model estimation

For example, you can run the complete causal inference pipeline:


library(EconCausal)

# Run comprehensive causal analysis

results <- econ_causal_analysis(

data = your_time_series,

methods = c("ECM_MARS", "BSTS", "BGLM_AR1"),

validation_windows = 12,

stability_threshold = 0.7

)

# Extract causal relationships with temporal stability

stable_relationships <- results$stable_causality

validation_metrics <- results$temporal_validation

This addresses critical questions in economic policy: Which economic variables genuinely drive others? Are these relationships stable enough to base policy decisions on? These are questions that traditional econometric methods struggle with because they don't adequately test temporal stability—a relationship that holds in one period may completely break down in another.

The key innovation lies in the integrated protocol novelty: while individual components (ECM, MARS, BSTS) exist in the literature, EconCausal is the first to combine dual decision rules (ELPD + RMSE), explicit support thresholds, and rolling-origin temporal validation in a single reproducible workflow. Our comprehensive review found no identical protocols in either academic literature or industrial frameworks that package all these elements with the same rigor.

Beyond economics, the framework applies to any domain investigating causal relationships in temporal data: neuroscience (brain activity causation), climate science (environmental cause-effect chains), epidemiology (disease transmission dynamics), and finance (market causality patterns).

The EconCausal package is available on GitHub: IsadoreNabi/EconCausal. It's easily installed with:


devtools::install_github("IsadoreNabi/EconCausal")

You'll find detailed methodological explanations and real-world applications in my Philosophy of Statistics blog posts (English and Spanish versions). There I explain the theoretical foundations behind each methodology and demonstrate applications in production-circulation analysis, with extensions to other causal inference problems.

By providing the first integrated framework for temporally validated causal inference, this package fills a critical gap in econometric analysis—enabling researchers and policymakers to distinguish between spurious correlations and genuine, stable causal relationships. I hope you'll try it and let me know what you think!