📦 Announcing `bivarhr`: A Package for Bivariate Hurdle Models and Causal Inference

Hello R Community,

I'm excited to announce the first stable release of bivarhr, an R package now available on CRAN. This package is designed for econometricians, epidemiologists, and analysts working with correlated count time series that exhibit excess zeros.

What does it do?
Drawing from the wiki documentation, bivarhr provides a unified framework for analyzing paired count variables (e.g., insurgent attacks vs. counter-operations, or disease incidence vs. mortality). The core functions help you:

  • Estimate Bivariate Hurdle Models: Jointly model zero-inflated count data using truncated negative binomial distributions.
  • Perform Robust Causal Inference: Apply a suite of tools including Transfer Entropy, Dynamic Bayesian Networks (DBN), and Hidden Markov Models (HMM) to validate Granger-causal relationships.
  • Implement Bayesian Model Averaging: Use stacking weights and horseshoe priors for automatic variable selection and regularization in high-dimensional settings.

At its core, the package addresses the challenge of modeling two dependent count series where zeros are frequent and cross-lagged effects are critical. It moves beyond univariate approaches by offering a joint hurdle framework that rigorously tests for structural causality with full Bayesian uncertainty quantification.

Why is it useful?
Modeling bivariate counts with excess zeros is notoriously difficult with standard Poisson or Negative Binomial tools. bivarhr makes this complex workflow accessible, combining rigorous Bayesian inference (via Stan) with advanced causal validation methods to ensure your findings are robust to model misspecification.

Getting Started:

The package vignettes and wiki provide detailed examples, from analyzing conflict dynamics to epidemiological modeling. I hope bivarhr becomes a valuable tool in your applied econometrics or causal inference workflow.

I welcome any feedback, bug reports, or contributions on GitHub. What are your experiences or challenges with bivariate count data?

Best,

José Mauricio Gómez Julián