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\}.\]coverageis 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 probabilityregion.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.
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_regionon a law or smooth map.massestimates 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.