← Back to all sparks
B

bpbounds

ANALYTICS
Velocity0.0

Nonparametric Bounds for the Average Causal Effect Due to Balke and Pearl and Extensions

bpbounds found the same swapped-cell bug twice and clamped its bounds back into range

causal inferenceinstrumental variablesrpartial identificationcorrectnessepidemiology
Current state
bpbounds computes nonparametric Balke-Pearl bounds on the average causal effect from instrumental variable data, in the bivariate and trivariate cases. After years of pure packaging maintenance, the two 2026 releases are analytical corrections. Bounds on intervention probabilities are now clamped to [0, 1] so derived causal risk ratio bounds cannot fall outside their feasible range, and a cell-ordering error in the trivariate three-category instrument path has been repaired.
Where it's heading
The direction is toward agreement with the reference Stata implementation and away from silently wrong output. The clamping change is described as matching the same fix in the Stata package, which suggests the two implementations are being reconciled rather than developed independently. The cell-ordering defect is the more instructive one: it was fixed in the calculation function in 0.1.7 and then again in the constraint matrix in 0.1.8, meaning the same x=0,y=1 / x=1,y=0 swap had been written in two places.
Prediction
Since the recent fixes came from an external contributor's report and both touched the trivariate three-category path, the untested corners of that path are where further corrections would surface — but the release notes give no roadmap beyond parity with the Stata package.

Recent moves

  1. 1mo ago

    bpbounds clamps probability bounds and fixes a constraint-matrix swap

    Two corrections that change output. Intervention probability bounds and their monotonicity counterparts are clamped to [0, 1] so the causal risk ratio bounds derived from them stay feasible, matching the Stata package. Separately, the conditional probabilities feeding the constraint matrix for a three-category instrument had the x=0,y=1 and x=1,y=0 cells swapped within each category of Z — which could report the IV inequality as violated on valid data and yield incorrect ACE bounds.

    View source ↗
  2. 2mo ago

    bpbounds fixes swapped cells in the trivariate calculation

    The first half of the same defect: bpbounds_calc_tri_z3() had the x=0,y=1 and x=1,y=0 conditional probability cells swapped for each category of Z, giving wrong bounds for the trivariate three-category instrument. Reported by an outside contributor. The release also raises the R floor to 4.1, drops dplyr as a soft dependency and moves to the native pipe.

    View source ↗
  3. 2y ago

    bpbounds 0.1.6

    Formatting in examples and the vignette, an R 4.0.0 floor inherited from knitr's dependency chain, and a roxygen2 bump. Packaging only.

    View source ↗
  4. 3y ago

    bpbounds 0.1.5

    Metadata and packaging edits — affiliations, LazyData removed, a simplified NAMESPACE, pkgdown site improvements.

    View source ↗
  5. 6y ago

    Version 0.1.4 on CRAN

    A maintainer email address change, released to CRAN. Nothing else.

    View source ↗
  6. 7y ago

    Version 0.1.3

    An ORCID added to DESCRIPTION. Representative of the package's long quiet stretch before the 2026 corrections.

    View source ↗