dcor.independence.distance_correlation_t_statistic

distance_correlation_t_statistic(x, y)[source]

Statistic used in distance_correlation_t_test().

Parameters
  • x (T) – First random vector. The columns correspond with the individual random variables while the rows are individual instances of the random vector.

  • y (T) – Second random vector. The columns correspond with the individual random variables while the rows are individual instances of the random vector.

Returns

T statistic.

Return type

T

See also

distance_correlation_t_test

Examples

>>> import numpy as np
>>> import dcor
>>> a = np.array([[1, 2, 3, 4],
...               [5, 6, 7, 8],
...               [9, 10, 11, 12],
...               [13, 14, 15, 16]])
>>> b = np.array([[1, 0, 0, 1],
...               [0, 1, 1, 1],
...               [1, 1, 1, 1],
...               [1, 1, 0, 1]])
>>> with np.errstate(divide='ignore'):
...     dcor.independence.distance_correlation_t_statistic(a, a)
inf
>>> dcor.independence.distance_correlation_t_statistic(a, b)
...                                      
-0.4430164...
>>> with np.errstate(divide='ignore'):
...     dcor.independence.distance_correlation_t_statistic(b, b)
inf