moscot.problems.spatiotemporal.SpatioTemporalProblem.compute_random_distance¶
- SpatioTemporalProblem.compute_random_distance(source, intermediate, target, interpolation_parameter=None, n_interpolated_cells=None, account_for_unbalancedness=False, posterior_marginals=True, seed=None, backend='ott', **kwargs)¶
Compute Wasserstein distance between randomly interpolated and intermediate cells.
See also
TODO(MUCDK): create an example showing the usage.
This function interpolates cells between the
sourceandtargetdistributions using a random OT coupling to approximate cells at theintermediatetime point.- Parameters:
source (
TypeVar(K, bound=Hashable)) – Key identifying the source distribution.intermediate (
TypeVar(K, bound=Hashable)) – Key identifying the intermediate distribution.target (
TypeVar(K, bound=Hashable)) – Key identifying the target distribution.interpolation_parameter (
Optional[float]) – Interpolation parameter in \((0, 1)\) defining the weight of thesourceandtargetdistributions. IfNone, it is linearly interpolated.n_interpolated_cells (
Optional[int]) – Number of cells used for interpolation. IfNone, use the number of cells in theintermediatedistribution.account_for_unbalancedness (
bool) – Whether to account for unbalancedness by assuming exponential cell growth and death.posterior_marginals (
bool) – Whether to useposterior_growth_ratesorprior_growth_rates. TODO(MUCDK): needs more explanationseed (
Optional[int]) – Random seed used when sampling the interpolated cells.backend (
Literal['ott']) – Backend used for the distance computation.**kwargs (
Any) – The description is missing.
- Return type:
- Returns:
: The distance between randomly interpolated cells and cells at the
intermediatetime point.