Skip to content

Explicit return added in case K = 0 as bcaboot.return() only adds a class attribute.#8

Open
bettinagruen wants to merge 3 commits intobnaras:masterfrom
bettinagruen:bettinagruen-patch-1
Open

Explicit return added in case K = 0 as bcaboot.return() only adds a class attribute.#8
bettinagruen wants to merge 3 commits intobnaras:masterfrom
bettinagruen:bettinagruen-patch-1

Conversation

@bettinagruen
Copy link
Copy Markdown

This resolves errors obtained with K = 0 for bcajack(), bcajack2(), bcapar().

Explicit return added when K = 0 to stop function execution.
Explicit return added when K = 0 to stop function execution.
Explicit return added when K = 0 to stop function execution.
@bettinagruen bettinagruen changed the title Bettinagruen patch 1 Explicit return added in case K = 0 as bcaboot.return() only adds a class attribute. Feb 2, 2022
@bnaras
Copy link
Copy Markdown
Owner

bnaras commented Feb 2, 2022

Thank you @bettinagruen

bnaras added a commit that referenced this pull request Apr 8, 2026
Issue #2: Grouped jackknife Imat construction was using
sapply(seq_len_m, sample.int, ...) which passed iteration values
as the first positional arg of sample.int, overriding the keyword
n= and enabling replacement. Fix: matrix(sample.int(n, n-r), nrow=m)
restores the correct without-replacement partition. Regenerated
bcajack fixture since old fixture captured buggy acceleration values.

Issue #7: Matrix subsetting x[-i, ] on single-column matrices drops
the dimension, returning a vector instead of a matrix. This causes
type inconsistency between jackknife (vector) and bootstrap (matrix)
calls to func. Fix: drop=FALSE on all 5 matrix subsetting sites
that pass data to func (jackknife_accel, bootstrap_resample, bca_nonpar).

Issue #4/#1 (+ PR #5 idea): regression_accel silently produced NAs
when ncol(Y) > length(nearby_idx), making lm() underdetermined.
Fix: explicit check with actionable error message suggesting to
increase B, increase kl_fraction, or use accel="jackknife".

PR #8 (Bettina Gruen): Missing return() in K=0 path was already
fixed in the tidy rewrite — bca_nonpar/bca_par use explicit
return(new_bcaboot(...)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants