Open-source · github.com/YuZh98/combreg
combreg
Bayesian regression for combinatorial response data: each response is a binary vector constrained to an integral polytope, $\mathcal{Y} = {,y \in {0,1}^d : A y \le b,}$. Ignoring the constraint and fitting an unconstrained model leads to biased estimation, and enumerating all feasible outcomes is computationally impractical in high-dimensional settings. In Zheng, Ghosh & Duan (2026), an augmented likelihood that respects the combinatorial constraints is proposed, along with a Metropolis–Hastings-within-Gibbs (MH-Within-Gibbs) sampler that scales to high-dimensional problems.
The package implements the MH-Within-Gibbs sampler of Zheng, Ghosh & Duan (2026), with hit-and-run dual updates in C++ (OpenMP-parallel across observations), an unconstrained probit baseline, one-call benchmarking, MCMC and regression diagnostics, and utilities for constraint validation and data simulation.
Installation
Install the released version from CRAN:
| |
Or the development version from GitHub:
| |
Building from source requires a C++17 toolchain (the package links to
RcppArmadillo); OpenMP is used when available and falls back to a serial build
otherwise.
Usage
| |
Overview
| Component | Functions |
|---|---|
| Model fitting | crr(), crr_control(), crr_prior() |
| Constraints | crr_constraints(), is_tum(), is_feasible() |
| Simulation | simulate_crr(), random_constraints() |
| Diagnostics | crr_diagnostics(), crr_ess(), crr_rhat(), crr_ppc() |
| Benchmarking | crr_benchmark() |
| Methods | summary(), coef(), predict(), fitted(), residuals(), plot(), as.mcmc(), as_draws() |
| Sampling primitives | init_dual(), sample_dual(), draw_utility(), sample_utility(), dual_feasible(), coef_precompute(), update_coef() |
Two vignettes and a R script cover the details:
vignette("combreg"): the model, why constraint-ignoring baselines are biased, constraint setup, the adaptive block controller, and building custom models from the exported primitives.vignette("diagnostics"): the diagnostics and benchmarking workflow.inst/scripts/reproduce-table2.R: runs the simulation in Zheng, Ghosh & Duan (2026) and reproduces its Table 2 (coefficient RMSE for varying(d, m)).
Citation
| |
Zheng, Y., Ghosh, M., & Duan, L. (2026). Statistical Modeling of Combinatorial Response Data. Journal of the American Statistical Association, advance online publication. https://doi.org/10.1080/01621459.2026.2714575
License
MIT © Hugh Zheng