bcaboot 1.0
Breaking changes
New primary API:
bca_nonpar()replacesbcajack(),bcajack2(), andbcanon().bca_par()replacesbcapar().All computation functions now return a canonical
"bcaboot"object with consistent structure:$limits(9x4 matrix),$stats(2x5 matrix),$B_mean,$ustats. The old field names ($lims,$B.mean) are aliased via$.bcabootfor backward compatibility.User-facing parameter
conf.level(e.g.,c(0.95, 0.90)) replacesalpha(e.g.,c(0.025, 0.05)). Internally, alpha expansion is unchanged.Descriptive parameter names:
n_groups(wasm),group_reps(wasmr),kl_fraction(waspct),n_jack(wasK),jack_groups(wasJ),truncation(wastrun),conf_density(wascd),boot_data(was overloadedB).bcanon()removed (was never on CRAN).
Deprecations
-
bcajack(),bcajack2(),bcapar(), andbcaplot()are deprecated withlifecyclewarnings (once per session). They will continue to work through thin wrappers that translate to the new API.
Bug fixes
Issue #2: Fixed grouped jackknife (
n_groups < n) usingsapply(seq_len_m, sample.int, ...)which accidentally passed iteration values as the first positional arg, overriding then=keyword and enabling replacement. Replaced withmatrix(sample.int(n, n-r), nrow=m)for correct without-replacement partition. (Reported by admash)Issue #7: Fixed dimension drop when
xis a single-column matrix (vector input).x[-i, ]on ann x 1matrix returned a vector instead of a matrix, causing type inconsistency between jackknife and bootstrap code paths. Addeddrop = FALSEto all matrix subsetting passed tofunc. (Reported by R180)Issue #4 / #1:
regression_accelnow checks for underdetermined regression (nearby samples < ncol(Y)) and errors with an actionable message instead of silently returning NAs. Suggests increasingB, increasingkl_fraction, or switching toaccel = "jackknife". (Reported by Tim Pollington, Thomas Covert)PR #8: Fixed missing
return()inK = 0early-exit path ofbcajack(),bcajack2(), andbcapar(), which caused execution to fall through to theK > 0code. In the rewrite, all early exits use explicitreturn(new_bcaboot(...)). (Reported by Bettina Gruen)
New features
tidy()method: returns a tibble with one row per (confidence level, method) pair, following broom conventions (conf.level,method,estimate,conf.low,conf.high).glance()method: returns a one-row tibble summarizing the bootstrap run (method,accel,theta,sdboot,z0,a,sdjack,B,boot_mean).autoplot()method: ggplot2 visualization of BCa vs standard confidence intervals. Requires ggplot2 (in Suggests).Improved
print(): formatted summary with confidence limits table instead of raw list dump.bca_nonpar()always computes the gbca diagnostic when usingaccel = "regression"(withtryCatchfor robustness).All user-facing messages use
clifor consistent formatting.
Dependencies
- Added
cli,tibble,generics,lifecycleto Imports. - Added
ggplot2to Suggests (forautoplot()).
Internal
- Shared helpers extracted to
R/bca_core.R:expand_alpha(),bootstrap_resample(),jackknife_accel(),regression_accel(),compute_ustats(). -
new_bcaboot()canonical constructor guarantees consistent return structure across all computation functions. - Test suite expanded from 14 to 34 tests, including adapter tests proving numerical equivalence against pre-1.0 fixtures.
