pyvale.validation.ecdfops module

Extract conditional empirical distributions without plotting or pooling axes.

calc_ecdf(samples)[source]

Calculate a 1D ECDF, omitting NaNs and preserving duplicate mass.

Parameters:

samples (ndarray) – Aleatory observations of shape (n_aleatory,) for one conditional distribution.

Returns:

ECDF – Sorted distinct observations and cumulative empirical masses, each with shape (n_support,). NaNs are omitted; repeated values contribute their full mass.

evaluate_ecdf_quantiles(cdf, probabilities)[source]

Evaluate the inverse ECDF using the first support reaching each probability.

Parameters:
  • cdf (ECDF) – Empirical distribution with matching one-dimensional support and probability arrays.

  • probabilities (ndarray) – One-dimensional cumulative probabilities, with shape (n_probs,).

Returns:

ndarray – Quantiles of shape (n_probs,), in input probability order. Each value is the first support point whose cumulative mass reaches the requested probability.

select_ecdf_support_sum_cases(samples)[source]

Select whole cases by the minimum and maximum sums of unique support.

Parameters:

samples (tuple[ndarray, ]) – Tuple of original conditional sample arrays. Each array has shape (n_aleatory,) for its case; lengths may differ.

Returns:

tuple[int, int] – Indices of the cases with the minimum and maximum sum of distinct finite support values, in that order. Ties choose the first case.

calc_ecdf_view(quantity, *, view=None, point_idx=0, component_idx=0, time_idx=0, offset=EEpisOffset.NOMINAL)[source]

Calculate conditional quantile curves without pooling epistemic samples.

Select each axis first, then reduce nuisance before transferable uncertainty. Mean/median are pointwise quantile operations with equal case weights; they do not assign probabilities to epistemic uncertainty. Original case overlays remain unchanged by reductions. None offset explicitly spans every available coherent offset; the default retains nominal values only.

Parameters:
  • quantity (ValidArray) – Observations paired with their canonical named axes.

  • view (ECDFViewSel or None, optional) – Epistemic selection and reduction settings. Use None for the default selection.

  • point_idx (int, optional) – Zero-based physical sampling point index.

  • component_idx (int, optional) – Zero-based observable component index.

  • time_idx (int, optional) – Zero-based evaluation time index.

  • offset (EEpisOffset or None, optional) – Coherent offset to apply. Use None to include nominal and all available offsets.

Returns:

ECDFView – Original and reduced quantiles on a common grid, with axes (transferable, nuisance, offset, probability). Reduced dimensions remain singleton axes.

calc_ecdf_epis_bounds(view)[source]

Find pointwise quantile bounds and their controlling epistemic cases.

Parameters:

view (ECDFView) – Computed ECDF view with aligned quantile curves and original case metadata.

Returns:

ECDFEpisBounds – Pointwise lower and upper quantiles on the view’s shared probability grid, with controlling case indices.