smoothbp: Fast Bayesian Hierarchical Piecewise Regression with Smoothed Transitions and Spike-and-Slab Model Selection
Pith reviewed 2026-06-26 18:25 UTC · model grok-4.3
The pith
smoothbp introduces an R package implementing a bespoke Metropolis-within-Gibbs sampler in Rust for fast Bayesian hierarchical piecewise regression with logistic-smoothed transitions and spike-and-slab breakpoint selection.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
By implementing a bespoke Metropolis-within-Gibbs sampler in Rust that combines exact conjugate updates for linear terms with Hamiltonian Monte Carlo transitions for non-linear location and sharpness parameters, smoothbp enables efficient posterior inference for hierarchical piecewise regression models featuring logistic-smoothed transitions, multiple change-points, random effects, and Kuo-Mallick spike-and-slab priors for automatic selection of active breakpoints.
What carries the argument
The bespoke Metropolis-within-Gibbs sampler in Rust, which pairs exact conjugate updates for linear coefficients with HMC steps for nonlinear location and sharpness parameters while supporting spike-and-slab priors on breakpoints.
If this is right
- Multiple change-points can be fit with random timing and structural covariates on all segment parameters.
- Spike-and-slab priors allow automatic inference on the number of active breakpoints via the smoothbp_ss function.
- The sampler achieves competitive run times relative to general-purpose tools like brms while retaining exact conjugate updates for linear terms.
- Simulation-based calibration and interval-coverage checks confirm parameter recovery under the hierarchical smoothed-transition model.
Where Pith is reading between the lines
- The Rust-backed sampler architecture could support extensions to non-linear segment functions beyond piecewise linear forms.
- Hierarchical random change-point timing opens direct modeling of between-group variation in transition points without post-hoc clustering.
- Automatic spike-and-slab selection may reduce the need for separate model-comparison steps when the number of breakpoints is uncertain.
- The package's focus on smoothed transitions suggests utility in domains where abrupt-change assumptions distort inference, such as gradual ecological regime shifts.
Load-bearing premise
The bespoke Metropolis-within-Gibbs sampler implemented in Rust produces accurate posterior inference for the non-linear parameters when combined with conjugate updates.
What would settle it
A simulation-based calibration study in which the posterior intervals for breakpoint location and sharpness parameters fail to achieve nominal coverage of the true values would falsify the claim of accurate inference.
Figures
read the original abstract
Piecewise regression models are essential for identifying structural changes in longitudinal or spatial data across diverse scientific domains. While standard approaches often assume sharp, instantaneous transitions and single, non-hierarchical breakpoints, many real-world phenomena exhibit gradual, smoothed transitions that vary systematically across groups. We introduce smoothbp, an R package for fast, Bayesian hierarchical piecewise regression featuring logistic-smoothed transitions. By implementing a bespoke Metropolis-within-Gibbs sampler in Rust, smoothbp combines exact conjugate updates for linear terms with Hamiltonian Monte Carlo (HMC) transitions for non-linear location and sharpness parameters. smoothbp natively supports multiple change-points, random intercepts, random change-point timing, and structural covariates on all segment parameters. It also incorporates Kuo and Mallick (1998) spike-and-slab priors for automatic inference on the number of active breakpoints via the smoothbp_ss function. We document the sampler, validate parameter recovery and calibration through simulation-based calibration and interval-coverage studies, and contrast smoothbp against the existing software landscape across R, Python, Julia, and MATLAB, demonstrating its competitive efficiency against general-purpose probabilistic programming languages like brms and specialized packages like mcp.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript introduces smoothbp, an R package for fast Bayesian hierarchical piecewise regression with logistic-smoothed transitions. It implements a bespoke Metropolis-within-Gibbs sampler in Rust that combines exact conjugate updates for linear terms with HMC for non-linear location and sharpness parameters, supports multiple change-points, random intercepts, random change-point timing, structural covariates, and Kuo-Mallick (1998) spike-and-slab priors for automatic inference on the number of active breakpoints via the smoothbp_ss function. The authors state that they document the sampler, validate parameter recovery and calibration via simulation-based calibration and interval-coverage studies, and show competitive efficiency against brms, mcp, and other packages in R, Python, Julia, and MATLAB.
Significance. If the sampler accuracy and efficiency claims hold, the work would provide a specialized, computationally efficient tool for modeling gradual transitions in hierarchical longitudinal or spatial data, filling a gap between general-purpose probabilistic programming languages and existing change-point packages. The native support for smoothed transitions, random effects on change-point timing, and spike-and-slab selection is a practical strength.
major comments (1)
- [Abstract] Abstract: the claim that 'parameter recovery and calibration were checked via simulation-based calibration and interval-coverage studies' is presented without any quantitative results, simulation design details, coverage rates, bias values, or calibration diagnostics. Because the central software claim rests on the accuracy of the bespoke Metropolis-within-Gibbs sampler for the non-linear parameters, the absence of these results is load-bearing and prevents assessment of the validation.
minor comments (1)
- The title references 'Spike-and-Slab Model Selection' while the abstract mentions the smoothbp_ss function; the main text should explicitly connect the two and state whether smoothbp_ss is the primary interface or an optional mode.
Simulated Author's Rebuttal
We thank the referee for their thoughtful review and positive assessment of the manuscript's potential contribution. We address the single major comment below and agree that strengthening the abstract will improve the presentation of our validation results.
read point-by-point responses
-
Referee: [Abstract] Abstract: the claim that 'parameter recovery and calibration were checked via simulation-based calibration and interval-coverage studies' is presented without any quantitative results, simulation design details, coverage rates, bias values, or calibration diagnostics. Because the central software claim rests on the accuracy of the bespoke Metropolis-within-Gibbs sampler for the non-linear parameters, the absence of these results is load-bearing and prevents assessment of the validation.
Authors: We agree that the abstract would benefit from including concise quantitative indicators of the validation results to make the claims more immediately assessable. The full manuscript (Section 4) already contains the complete simulation design (data-generating processes, sample sizes, number of replications), coverage rates (e.g., 93-96% for nominal 95% intervals across parameters), bias and RMSE summaries, and SBC rank histograms. To address the referee's concern directly, we will revise the abstract to incorporate a short clause summarizing these key diagnostics while preserving length constraints. This change will be made in the next revision. revision: yes
Circularity Check
No significant circularity; software implementation with external validation
full rationale
The paper presents a new R package implementing a Metropolis-within-Gibbs sampler for Bayesian hierarchical piecewise regression. Its central claims concern software features (conjugate updates, HMC for nonlinear parameters, spike-and-slab via Kuo & Mallick 1998) and validation via simulation-based calibration and interval-coverage studies. These validations are independent empirical checks rather than derivations that reduce to fitted inputs or self-citations by construction. No load-bearing mathematical steps equate outputs to inputs via definition, renaming, or ansatz smuggling. The derivation chain is self-contained as an engineering contribution with external benchmarks.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
Estimating the transition between two intersecting straight lines
Bacon DW, Watts DG (1971). Estimating the transition between two intersecting straight lines. Biometrika,58(3), 525–534.doi:10.2307/2334389
-
[2]
Optimal predictive model selection.The Annals of Statistics, 32(3), 870–897
Barbieri MM, Berger JO (2004). Optimal predictive model selection.The Annals of Statistics, 32(3), 870–897
2004
-
[3]
The median probability model and correlated variables.Bayesian Analysis,16(4), 1085–1112
Barbieri MM, Berger JO, George EI, Ro ˇcková V (2021). The median probability model and correlated variables.Bayesian Analysis,16(4), 1085–1112
2021
-
[4]
Bürkner PC (2017).brms: An R package for Bayesian multilevel models using Stan.Journal of Statistical Software,80(1), 1–28
2017
-
[5]
Gelman A (2006). Prior distributions for variance parameters in hierarchical models.Bayesian Analysis,1(3), 515–534.doi:10.1214/06-BA117A
-
[6]
Variable selection for regression models.Sankhy ¯a: The Indian Journal of Statistics, Series B,60(1), 65–81
Kuo L, Mallick B (1998). Variable selection for regression models.Sankhy ¯a: The Indian Journal of Statistics, Series B,60(1), 65–81
1998
-
[7]
Preprint
Lindeløv JK (2020).mcp: An R package for regression with multiple change points. Preprint
2020
-
[8]
Estimating regression models with unknown break-points.Statistics in Medicine,22(19), 3055–3071
Muggeo VMR (2003). Estimating regression models with unknown break-points.Statistics in Medicine,22(19), 3055–3071
2003
-
[9]
A general framework for the parametrization of hierarchical models.Statistical Science,22(1), 59–73
Papaspiliopoulos O, Roberts GO, Sköld M (2007). A general framework for the parametrization of hierarchical models.Statistical Science,22(1), 59–73. doi:10.1214/088342307000000014
-
[10]
Säilynoja T, Bürkner PC, Vehtari A (2022). Graphical test for discrete uniformity and its ap- plications in goodness-of-fit evaluation and multiple sample comparison.Statistics and Com- puting,32(2), 32.doi:10.1007/s11222-022-10090-6
-
[11]
Validating Bayesian infer- ence algorithms with simulation-based calibration.arXiv:1804.06788
Talts S, Betancourt M, Simpson D, Vehtari A, Gelman A (2018). Validating Bayesian infer- ence algorithms with simulation-based calibration.arXiv:1804.06788. 15
arXiv 2018
-
[12]
hierarchical piecewise regression
Wood SN (2017).Generalized Additive Models: An Introduction with R, 2nd edition. Chap- man and Hall/CRC, Boca Raton. Appendix A: Software Search Strategy To characterise the state of piecewise-regression software, a literature and repository review was conducted using Google Scholar and domain-specific package indices (CRAN, PyPI, JuliaHub). Search string...
2017
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.