pod.bootstrap_pod_ci

bootstrap_pod_ci(
    X,
    y,
    X_eval,
    threshold,
    model_type,
    model_params,
    bandwidth,
    dist_info,
    n_boot=1000,
    nuisance_ranges=None,
    n_jobs=None,
    feature_names=None,
    poi_names=None,
    confidence_levels=None,
    nuisance_dists=None,
)

Estimates Confidence Bounds for the PoD curve via Bootstrapping.

This function resamples the original data with replacement n_boot times. For each resample, it refits the Mean Model (dynamically rebuilding either a Polynomial or Kriging model), recalculates residuals, and generates a new PoD curve. If Kriging is selected, the optimizer is disabled during bootstrapping to remain computationally tractable.

Parameters

Name Type Description Default
X np.ndarray Original input data. required
y np.ndarray Original outcome data. required
X_eval np.ndarray Grid points for evaluation. required
threshold float Detection threshold. required
model_type str The type of mean model (‘Polynomial’ or ‘Kriging’). required
model_params Any Model parameters (integer degree for Poly, kernel for Kriging). required
bandwidth float Smoothing bandwidth (fixed from original fit). required
dist_info Tuple[str, Tuple] Error distribution (fixed from original fit). required
n_boot int Number of bootstrap iterations. Defaults to 1000. 1000
nuisance_ranges dict Nuisance ranges. None
n_jobs int | None Number of CPU cores to use. None
feature_names list Names of all feature columns in X. None
poi_names list Names of the parameters of interest (PoIs). None
confidence_levels list | None Specific confidence levels (e.g. [50, 90, 95, 99]) to return curves for. If provided, returns a dict of {level: (lower, upper)}. Otherwise, returns the standard Tuple (lower_95, upper_95). None
nuisance_dists dict Custom nuisance distribution configuration. None

Returns

Name Type Description
Tuple[np.ndarray, np.ndarray] | dict Tuple[np.ndarray, np.ndarray] | dict: If confidence_levels is None: - lower_ci: The 2.5th percentile PoD curve (Lower 95% Bound). - upper_ci: The 97.5th percentile PoD curve (Upper 95% Bound). If confidence_levels is a list: - dict: Mapping each confidence level to its (lower_ci, upper_ci) curves.