API List#

List of functions#

A complete list of all functions provided by dcor.

Biased estimators for distance covariance and distance correlation#

These functions compute the usual (biased) estimators for the distance covariance and distance correlation and their squares.

dcor.distance_covariance(x, y, *[, ...])

Usual (biased) estimator for the distance covariance.

dcor.distance_covariance_sqr(x, y, *[, ...])

Usual (biased) estimator for the squared distance covariance.

dcor.distance_correlation(x, y, *[, ...])

Usual (biased) estimator for the distance correlation.

dcor.distance_correlation_sqr(x, y, *[, ...])

Usual (biased) estimator for the squared distance correlation.

dcor.distance_stats(x, y, *[, exponent, ...])

Usual (biased) statistics related with the distance covariance.

dcor.distance_stats_sqr(x, y, *[, exponent, ...])

Usual (biased) statistics related with the squared distance covariance.

Unbiased and bias-corrected estimators for distance covariance and distance correlation#

These functions compute the unbiased estimators for the square of the distance covariance and the bias corrected estimator for the square of the distance correlation. As these estimators are signed, no functions are provided for taking the square root.

dcor.u_distance_covariance_sqr(x, y, *[, ...])

Unbiased estimator for the squared distance covariance.

dcor.u_distance_correlation_sqr(x, y, *[, ...])

Bias-corrected estimator for the squared distance correlation.

dcor.u_distance_stats_sqr(x, y, *[, ...])

Unbiased statistics related with the squared distance covariance.

Affinely invariant distance correlation#

These functions compute the estimators for the affinely invariant distance correlation, a variant of distance correlation that is invariant by invertible affine transformations of the input parameters.

dcor.distance_correlation_af_inv_sqr(x, y[, ...])

Square of the affinely invariant distance correlation.

dcor.distance_correlation_af_inv(x, y[, ...])

Affinely invariant distance correlation.

Partial distance covariance and partial distance correlation#

These functions compute the estimators for the partial distance covariance and partial distance correlation.

dcor.partial_distance_covariance(x, y, z)

Partial distance covariance estimator.

dcor.partial_distance_correlation(x, y, z)

Partial distance correlation estimator.

Energy distance#

The following function is an estimator for the energy distance between two random vectors.

dcor.energy_distance(x, y, *[, average, ...])

Estimator for energy distance.

Homogeneity test#

The following functions are used to test if random vectors have the same distribution.

dcor.homogeneity.energy_test_statistic(x, y, *)

Homogeneity statistic.

dcor.homogeneity.energy_test(*args[, ...])

Test of homogeneity based on the energy distance.

Independence test#

The following functions are used to test if two random vectors are independent.

dcor.independence.distance_covariance_test(x, y, *)

Test of distance covariance independence.

dcor.independence.distance_correlation_t_statistic(x, y)

Statistic used in distance_correlation_t_test().

dcor.independence.distance_correlation_t_test(x, y)

Test of independence for high dimension.

Internal computations#

These functions are used for computing the estimators of the squared distance covariance, and are also provided by this package.

dcor.double_centered(a, *[, out])

Return a copy of the matrix \(a\) which is double centered.

dcor.u_centered(a, *[, out])

Return a copy of the matrix \(a\) which is \(U\)-centered.

dcor.mean_product(a, b)

Average of the elements for an element-wise product of two matrices.

dcor.u_product(a, b)

Inner product in the Hilbert space of \(U\)-centered distance matrices.

dcor.u_projection(a)

Return the orthogonal projection function over \(a\).

dcor.u_complementary_projection(a)

Return the orthogonal projection function over \(a^{\perp}\).

Compute distance matrices#

These functions are used for computing distance matrices.

dcor.distances.pairwise_distances(x[, y, ...])

Pairwise distance between points.

Compute the same measure between different random variables#

This function is used to compute a measure such as distance covariance/correlation between different random variables. It will use an optimized implementation (possibly parallelized in multicore machines) when it is available.

dcor.rowwise(function, x, y, *[, rowwise_mode])

Compute a dependency measure between pairs of elements.

List of classes#

A complete list of all classes provided by dcor.

dcor.CompileMode(value)

Compilation mode of the algorithm.

dcor.DistanceCovarianceMethod(value)

Method used for computing the distance covariance.

dcor.EstimationStatistic(value)

A type of estimation statistic used for calculating energy distance.

dcor.HypothesisTest(pvalue, statistic)

Class containing the results of an hypothesis test.

dcor.RowwiseMode(value)

Rowwise mode of the algorithm.

dcor.Stats(covariance_xy, correlation_xy, ...)

Distance covariance related stats.