EI Namespace¶
The exported unibm.ei namespace groups the persistence-side workflow:
sample preparation, BM-path construction, stable-window selection, pooled
BM estimators, threshold estimators, plotting helpers, and bootstrap-based
covariance support.
ei
¶
Canonical EI-facing UniBM subpackage.
EI_DEFAULT_COVARIANCE_SHRINKAGE = 0.35
module-attribute
¶
EI_ALPHA = 0.05
module-attribute
¶
EI_CI_LEVEL = 1.0 - EI_ALPHA
module-attribute
¶
EI_TINY = 1e-08
module-attribute
¶
__all__ = ['EI_ALPHA', 'EI_CI_LEVEL', 'EI_DEFAULT_COVARIANCE_SHRINKAGE', 'EI_TINY', 'EiPathBundle', 'EiPreparedBundle', 'EiStableWindow', 'ExtremalIndexEstimate', 'ThresholdCandidate', 'bootstrap_bm_ei_path', 'bootstrap_bm_ei_path_draws', 'estimate_ferro_segers', 'estimate_k_gaps', 'estimate_native_bm_ei', 'estimate_pooled_bm_ei', 'extract_stable_path_window', 'plot_ei_fit', 'plot_ei_path', 'prepare_ei_bundle', 'select_stable_path_window']
module-attribute
¶
EiPathBundle
dataclass
¶
Observed BM-EI path ingredients for one base-path and block scheme.
theta_path and z_path are computed from the observed series over the
candidate block-size grid. stable_window and selected_level record
where that observed path is judged stable, while sample_statistics
preserves the per-block-size window statistics reused by native fixed-b
estimators.
EiPreparedBundle
dataclass
¶
Reusable EI preparation outputs derived from one observed series.
The bundle stores the cleaned observed values, the candidate block-size grid, all BM path variants, and threshold-side exceedance candidates so the native BM, pooled BM, and threshold estimators can all reuse the same preparation step.
EiStableWindow
dataclass
¶
Selected stable window on an integer tuning axis.
ExtremalIndexEstimate
dataclass
¶
Unified formal-EI result container.
Most users should read theta_hat and confidence_interval first, then
inspect stable_window, regression, and base_path to understand
which formal estimator produced the headline result. path_level,
path_theta, and path_eir are retained for path diagnostics and
plotting rather than for headline reporting.
ThresholdCandidate
dataclass
¶
One threshold-side EI fit before cross-threshold selection.
bootstrap_bm_ei_path(vec, *, base_path, sliding, block_sizes, reps, random_state, allow_zeros=False)
¶
Bootstrap the transformed BM-EI path on the full block-size grid.
bootstrap_bm_ei_path_draws(bootstrap_samples, *, block_sizes, path_keys=BM_PATH_KEYS, allow_zeros=False)
¶
Transform one raw bootstrap bank into selected BM-EI z-path draw matrices.
estimate_native_bm_ei(bundle, *, base_path, sliding, use_adjusted_chandwich=False)
¶
Estimate theta with a native single-block-size BM estimator.
estimate_pooled_bm_ei(bundle, *, base_path, sliding, regression, bootstrap_result=None, covariance_shrinkage=EI_DEFAULT_COVARIANCE_SHRINKAGE)
¶
Estimate theta by pooling an observed BM path over a stable window.
prepare_ei_bundle(vec, *, block_sizes=None, threshold_quantiles=(0.9, 0.95), allow_zeros=False)
¶
Prepare the observed-data ingredients reused across formal EI estimators.
plot_ei_fit(fit, *, file_path=None, dpi=1200, title=None, save=False, close=None)
¶
Plot one EI fit either as a retained path view or a threshold summary.
plot_ei_path(path, *, file_path=None, dpi=1200, title=None, save=False, close=None, xlabel='log(block size)', ylabel='extremal index')
¶
Plot one observed EI path together with its selected stable window.
extract_stable_path_window(path)
¶
Return the selected stable block levels and transformed values for one path.
select_stable_path_window(block_sizes, z_path, *, min_points=4, trim_fraction=0.15, roughness_penalty=0.75, curvature_penalty=0.5)
¶
Choose the most stable contiguous block-size window on the transformed EI path.
estimate_ferro_segers(bundle, *, threshold_quantiles=(0.9, 0.95))
¶
Estimate theta with the Ferro-Segers intervals estimator.
estimate_k_gaps(bundle, *, threshold_quantiles=(0.9, 0.95), k_grid=(1, 2))
¶
Estimate theta with the K-gaps likelihood.