HTDV

Hypothesis Testing for Dependent Variables with Unbalanced Data.

HTDV provides a unified R toolkit for inference on dependent, unbalanced data under strong-mixing conditions, combining hierarchical Bayesian estimation via Hamiltonian Monte Carlo with frequentist and distribution-free robustness anchors (fixed-b HAR, block bootstrap, adaptive conformal).

Validation card

The framework is shipped with two pre-registered validation studies, both reproducible end-to-end and with their summary tables exposed as package datasets. See vignette("HTDV-validation").

{r, eval = FALSE} library(HTDV) data(htdv_sim_summary) # simulation summary, 3069 rows data(htdv_empirical_benchmarks) # three-dataset external validation vignette("HTDV-validation") # full narrative

Installation

remotes::install_github("IsadoreNabi/HTDV")

rstan is required. Optional backends: bridgesampling (Bayes factors), loo (WAIC / PSIS-LOO), posterior (draws utilities), bayesplot (visualization), readxl (vignette).

Core API

Function Purpose
htdv_fit() Hierarchical Bayesian HMC fit.
htdv_envelope() Berger-robust envelope across models.
htdv_lrv() HAC long-run variance (Andrews bandwidth).
htdv_fixedb() Fixed-bandwidth HAR Wald test.
htdv_boot() Block bootstrap with automatic block length.
htdv_conformal() Adaptive conformal inference.
htdv_rope() ROPE-based posterior decision.
htdv_bf() Bridge-sampling Bayes factor.
htdv_waic_lfo() WAIC and leave-future-out CV.
htdv_stack() Predictive stacking.
htdv_diagnostics() MCMC diagnostics.
htdv_ppc() Posterior-predictive checks on dependence statistics.
htdv_equivalence_constants() Explicit TAC/WSC/MPC constants.
htdv_simstudy() Factorial Monte Carlo study (Section 12-bis).
htdv_simstudy_summary() Aggregate per-cell results.
htdv_simstudy_warnings() Flag cells in the limit-of-identification zone.

See vignette("HTDV-intro") for a walkthrough, vignette("HTDV-validation") for the full validation report.

Citation

Please cite both the package and the companion paper. Run citation("HTDV") for the current BibTeX entries.

License

MIT.