Quantile regions#

Fit source points with fit(), then request a region with T.quantile_region(coverage=0.9). See the guide for the construction and a worked example.

radius is the largest included reference-centre radius. labels are the zero-based labels of the included cells.

Transport.quantile_region(coverage)[source]#

Return the smallest quantile region reaching the requested coverage.

\[\Omega_r=\{z:\|T(z)\|\leq r\},\qquad J_r=\{j:\|m_j\|\leq r\}.\]

coverage is a probability in [0, 1], not the radius r. Choose the smallest r >= 0 with \(|J_r|/(n+1)\) at least this probability. Under exchangeability and almost-sure uniqueness of the augmented assignment, the region covers the next observation with probability region.coverage, averaging over fitted observations and the next candidate, not conditional on one fitted sample.

Equal-radius cells enter together, so achieved coverage can exceed the request. Selecting every cell gives the whole space, even for a request below 1. Requires the default reference-cell construction.

class yemale.ot.QuantileRegion[source]#

A finite-sample union of source cells selected by reference radius.

radius#

Reference-centre radius cutoff defining the region.

Type:

float

labels#

Zero-based labels of the included reference cells.

Type:

numpy.ndarray

property coverage#

Fraction of reference cells included in the region.

Under the assumptions in quantile_region, this is the next observation’s marginal coverage, not coverage conditional on the fit.

contains(point)[source]#

Return whether each point belongs to the region.

halfspaces()[source]#

Return (A, b) for every closed source cell in the region.

Density regions#

law.density_region(mass=0.9) selects points by density. Its mass is a numerical integral, not a future-data coverage guarantee. Smooth maps offer the same operation on their unnormalized density; see Smoothing.

threshold is the density cutoff. mass is the numerical mass included at that cutoff.

class yemale.ot.DensityRegion[source]#

Points whose density reaches a cutoff, including ties.

Build with density_region on a law or smooth map. mass estimates the included density integral, not the coverage of future observations.

mass#

Estimated density integral over the region, including cutoff ties.

Type:

float

property threshold#

Density cutoff; membership is compared in log space.

contains(points)[source]#

Return membership for one point or a batch, preserving batch axes.