Learn R Programming

bivarhr (version 0.1.5)

Bivariate Hurdle Regression with Bayesian Model Averaging

Description

Provides tools for fitting bivariate hurdle negative binomial models with horseshoe priors, Bayesian Model Averaging (BMA) via stacking, and comprehensive causal inference methods including G-computation, transfer entropy, Threshold Vector Autoregressive (TVAR) and Smooth Transition Autoregressive (STAR) models, Dynamic Bayesian Networks (DBN), Hidden Markov Models (HMM), and sensitivity analysis.

Copy Link

Version

Install

install.packages('bivarhr')

Version

0.1.5

License

MIT + file LICENSE

Maintainer

José Mauricio Gómez Julián

Last Published

December 19th, 2025

Functions in bivarhr (0.1.5)

.is_binary_like

Check if Vector is Binary-like
fit_one

Fit Single Bivariate Hurdle Model
export_results

Export Analysis Results
.read_te_all

Read transfer entropy results from CSV files
.scalar1

Coerce to numeric scalar safely
.write_sheet

Safely write a data frame to an Excel worksheet
export_results_xlsx

Export Results to Excel
.get_pval

Extract p-value from RTransferEntropy result
.get_stat

Extract TE statistic from RTransferEntropy result
get_hurdle_model

Get Default Hurdle Model
placebo_temporal

Temporal Placebo Test via Time-Index Permutations
make_lags

Create Lag Matrix
print_floor_smoketest

Print summary of FLOOR smoke test (ELPD ranking invariance)
prewhiten_rate_glm

Pre-whiten rate series with log-link Gaussian GLM
normalize_names

Normalize character names by stripping BOM and NBSP
prewhiten_count_glm

Pre-whiten count series with GLM / NegBin model
prewhiten_bin_glm

Pre-whiten binary series with logistic GLM
predict_multistep

Multi-step Predictive Simulation for the Bivariate Hurdle Model
run_sensemakr

Sensitivity Analysis to Unobserved Confounding (sensemakr)
.scalar1_chr

Coerce to character scalar safely
run_synth_bsts

Synthetic Control via BSTS (CausalImpact)
run_eba

Extreme-Bounds Analysis (EBA) over Control-Variable Combinations
run_hmm

Hidden Markov Model (HMM) for Path Dependence (Counts I and C)
summarise_varx_posthoc

Summarise VARX model fit and diagnostics
summarise_tvarstar_posthoc

Summarise nonlinear time-series models (TVAR and LSTAR)
load_saved_results

Load Saved Results from Directory
run_dbn

Fit a Two-Slice Dynamic Bayesian Network (DBN) for I, C, and Regime
smoketest_floor_elpd_invariance

Smoke Test for FLOOR ELPD Invariance
rolling_oos

Rolling Out-of-Sample Forecast Evaluation
select_by_bma

Select Best Model via Bayesian Model Averaging
run_transfer_entropy

Transfer Entropy for Counts, Rates, and Binary Series
run_varx

Fit VARX model with diagnostics for I and C
summarise_te_top3_posthoc

Summarise top-3 transfer entropy results (global)
standardize_continuous

Standardize Continuous Columns
summarise_te_top3_by_type_posthoc

Summarise top-3 transfer entropy results by type
standardize_continuous_in_place

Standardize Continuous Columns In Place
summarise_hurdle_top3_posthoc

Summarise top-3 Hurdle-NB models across control combos
summarise_placebo_top3_posthoc

Summarise top-3 temporal placebo results
rc_auto

Read CSV with automatic delimiter detection
read_bma_all

Read and consolidate BMA weight tables
add_qsig

Add BH-adjusted q-values and significance stars
.as_num1

Coerce to numeric and return first element
contrafactual_ATE

Contrafactual Average Treatment Effects (ATE) for the Bivariate Hurdle Model
build_design

Build Design Matrices for Bivariate Hurdle Model
disc_terciles

Discretize Numeric Vector into Terciles
bivarhr-package

bivarhr: Bivariate Hurdle Regression
.first_pvalue

Extract a p-value from nested test objects
add_sheet

Add a worksheet to an Excel workbook with flexible content
.get_coef

Safely extract coefficient matrix from an object
.build_model_with_floor

Build CmdStan model with custom FLOOR constant