aaanalysis.comp_bootstrap_ci

aaanalysis.comp_bootstrap_ci(values=None, n_rounds=1000, ci=0.95, seed=None)[source]

Compute a percentile bootstrap confidence interval of the mean.

Standard small-N uncertainty quantification over a per-protein metric vector (e.g. the output of comp_per_protein_ap()). Resamples with replacement; NaN values are dropped first. Deterministic given seed.

Added in version 1.1.0.

Parameters:
  • values (array-like, shape (n_proteins,)) – Per-protein metric values.

  • n_rounds (int, default=1000) – Number of bootstrap resamples.

  • ci (float, default=0.95) – Central confidence level in (0, 1).

  • seed (int, optional) – Random seed for reproducibility.

Returns:

Dictionary with keys 'mean' (mean of the finite values), 'ci_low' (lower bound of the ci interval), and 'ci_high' (upper bound of the ci interval).

Return type:

dict

See also

Examples

comp_bootstrap_ci reports a seeded percentile bootstrap confidence interval over a per-protein metric vector (e.g. the output of comp_per_protein_ap) for small-N uncertainty. It returns a dict {'mean', 'ci_low', 'ci_high'}.

import numpy as np
import aaanalysis as aa

ap = np.array([0.82, 0.91, 0.77, 0.88, 0.80])
ci = aa.comp_bootstrap_ci(values=ap, n_rounds=500, ci=0.95, seed=0)
ci
{'mean': 0.836, 'ci_low': 0.792, 'ci_high': 0.88105}