Skip to content

Add bootstrap inference options to LDTE/LPTE (partial compliance) - #151

Merged
TomeHirata merged 1 commit into
mainfrom
ccr-e30220fe-ga9flf-local-bootstrap
Oct 6, 2026
Merged

TomeHirata merged 1 commit into
mainfrom
ccr-e30220fe-ga9flf-local-bootstrap

Conversation

@TomeHirata

@TomeHirata TomeHirata commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #150 for the optional point in the JOSS review (openjournals/joss-reviews#11047): the partial-compliance methods didn't expose bootstrap inference options, unlike predict_dte/predict_pte.

Changes

  • predict_ldte / predict_lpte on SimpleLocalDistributionEstimator and AdjustedLocalDistributionEstimator (and the public compute_ldte / compute_lpte) take variance_type and n_bootstrap:
    • "moment" (default): the existing analytic pointwise intervals. Results are unchanged.
    • "multiplier": pointwise intervals from a multiplier bootstrap.
    • "uniform": a band that holds over all locations at once, using a max-t critical value from the multiplier bootstrap. Locations with zero variance (e.g. a CDF at or above the max outcome) are left out of the max.
    • Any other value raises ValueError.
  • How the bootstrap works: it reuses the per-observation influence functions the analytic variance already computes, so no models are refit. The stratum×arm terms are centered within each cell and the stratum term is constant within a stratum, so the cross terms cancel and mean(influence**2) equals the existing analytic sigma exactly. That makes "multiplier" a bootstrap of the same estimator as "moment". It uses the same multipliers as compute_confidence_intervals.
  • Argument order: variance_type and n_bootstrap sit before display_progress, matching predict_dte. Calls that pass display_progress positionally would need updating. All in-repo calls use keywords.
  • Docs: the Oregon tutorial gets a short note on the new options.

Testing

  • New tests:
    • the default equals explicit "moment"
    • "multiplier" half-widths are within 10% of "moment"
    • the "uniform" band is wider than the pointwise one and contains the estimate
    • LPTE with the adjusted estimator works for both bootstrap types
    • an invalid variance_type raises
    • unit tests for the bootstrap helper, covering its standard error and how zero-variance locations are handled
  • Full suite: 79 passed. ruff check . is clean.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

predict_ldte/predict_lpte (and compute_ldte/compute_lpte) now accept
variance_type (moment, multiplier, uniform) and n_bootstrap, matching
the inference API of predict_dte/predict_pte. The bootstrap reuses the
per-observation influence functions already computed for the analytic
variance (multiplier bootstrap), so no models are refit. The default
moment path is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LjhUSYBaHyrPdnQ7z13FKv
@TomeHirata
TomeHirata force-pushed the ccr-e30220fe-ga9flf-local-bootstrap branch from a5add3a to 20cdcc2 Compare October 6, 2026 11:57
@TomeHirata
TomeHirata merged commit 9b95f33 into main Oct 6, 2026
10 checks passed
@TomeHirata
TomeHirata deleted the ccr-e30220fe-ga9flf-local-bootstrap branch October 6, 2026 12:13
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.

3 participants