Skip to content

CDF Helper

The standalone unibm.cdf module exposes the public empirical CDF helper reused by EI path preparation. Its retained behavior is a scaled-rank helper, not the ordinary normalized empirical distribution in every case:

  • It flattens the sample and removes non-finite sample values.
  • For more than one retained value, it returns count(X <= q) / (n + 1). It therefore reaches n / (n + 1), not 1, above the sample maximum.
  • A singleton instead uses the exact one-point step distribution.
  • An empty retained sample returns NaN; a NaN query also returns NaN.

EI preparation validates the observation series before calling this helper. Do not use the helper's permissive input cleanup to justify deleting missing time positions from an EI series.

cdf

Public empirical CDF helper shared across UniBM workflows.

__all__ = ['empirical_cdf'] module-attribute

_as_finite_1d(vec)

Flatten an array-like sample and omit its non-finite observations.

_empty_cdf_estimator()

Return a CDF estimator that yields NaN on every query.

_singleton_cdf_estimator(point)

Return the exact CDF of a single-point empirical distribution.

empirical_cdf(vec)

Return a callable that evaluates right-inclusive empirical ranks.

Flatten the sample and omit NaN and infinite observations. For at least two retained values, a query q returns count(x <= q) / (n + 1). This plotting-position convention stays below one even above the sample maximum; it is not the usual empirical CDF with denominator n. Ties use the largest rank, which includes every observation equal to q.

An empty sample gives NaN everywhere. A singleton instead uses its exact point-mass CDF (zero below the point, one otherwise). The callable accepts scalars or arrays, preserves the query shape, and propagates NaN queries.