{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _stats_py / _cdf_distance

function

scipy.stats._stats_py:_cdf_distance

source: /scipy/stats/_stats_py.py :9774

Signature

def   _cdf_distance ( p u_values v_values u_weights = None v_weights = None )

Summary

Compute, between two one-dimensional distributions and , whose respective CDFs are and , the statistical distance that is defined as:

Extended Summary

p is a positive parameter; p = 1 gives the Wasserstein distance, p = 2 gives the energy distance.

Parameters

u_values, v_values : array_like

Values observed in the (empirical) distribution.

u_weights, v_weights : array_like, optional

Weight for each value. If unspecified, each value is assigned the same weight. u_weights (resp. v_weights) must have the same length as u_values (resp. v_values). If the weight sum differs from 1, it must still be positive and finite so that the weights can be normalized to sum to 1.

Returns

distance : float

The computed distance between the distributions.

Notes

The input distributions can be empirical, therefore coming from samples whose values are effectively inputs of the function, or they can be seen as generalized functions, in which case they are weighted sums of Dirac delta functions located at the specified values.

Aliases

  • scipy.stats._stats_py._cdf_distance