de.lmu.ifi.dbs.elki.math.statistics.dependence

## Class HoeffdingsDDependenceMeasure

• All Implemented Interfaces:
DependenceMeasure

@Reference(authors="W. Hoeffding",
title="A non-parametric test of independence",
booktitle="The Annals of Mathematical Statistics 19",
url="http://www.jstor.org/stable/2236021",
bibkey="journals/mathstat/Hoeffding48")
public class HoeffdingsDDependenceMeasure
extends AbstractDependenceMeasure
Calculate Hoeffding's D as a measure of dependence.

References:

W. Hoeffding:
A non-parametric test of independence
The Annals of Mathematical Statistics 19:546–57

The resulting value is scaled by 30, so it is in the range [-.5;1].

Since:
0.7.0
Author:
Yinchong Yang, Erich Schubert
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  HoeffdingsDDependenceMeasure.Parameterizer
Parameterization class.
• ### Field Summary

Fields
Modifier and Type Field and Description
static HoeffdingsDDependenceMeasure STATIC
Static instance.
private static double[] TABPOS
private static double[] TABVAL
• ### Constructor Summary

Constructors
Modifier Constructor and Description
protected  HoeffdingsDDependenceMeasure()
Constructor - use STATIC instance.
• ### Method Summary

All Methods
Modifier and Type Method and Description
protected static <A,B> double[] computeBivariateRanks(NumberArrayAdapter<?,A> adapter1, A data1, NumberArrayAdapter<?,B> adapter2, B data2, int len)
Compute bivariate ranks.
<A,B> double dependence(NumberArrayAdapter<?,A> adapter1, A data1, NumberArrayAdapter<?,B> adapter2, B data2)
Measure the dependence of two variables.
double toPValue(double d, int n)
Convert Hoeffding D value to a p-value.
• ### Methods inherited from class de.lmu.ifi.dbs.elki.math.statistics.dependence.AbstractDependenceMeasure

clamp, computeNormalizedRanks, discretize, index, ranks, ranks, size, size, sortedIndex
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Methods inherited from interface de.lmu.ifi.dbs.elki.math.statistics.dependence.DependenceMeasure

dependence, dependence, dependence
• ### Field Detail

• #### STATIC

public static final HoeffdingsDDependenceMeasure STATIC
Static instance.
• #### TABVAL

private static final double[] TABVAL
• #### TABPOS

private static final double[] TABPOS
• ### Constructor Detail

• #### HoeffdingsDDependenceMeasure

protected HoeffdingsDDependenceMeasure()
Constructor - use STATIC instance.
• ### Method Detail

• #### dependence

public <A,B> double dependence(NumberArrayAdapter<?,A> adapter1,
A data1,
B data2)
Description copied from interface: DependenceMeasure
Measure the dependence of two variables. This is the more flexible API, which allows using different internal data representations.
Type Parameters:
A - First array type
B - Second array type
Parameters:
adapter1 - First data adapter
data1 - First data set
adapter2 - Second data adapter
data2 - Second data set
Returns:
Dependence measure
• #### computeBivariateRanks

protected static <A,B> double[] computeBivariateRanks(NumberArrayAdapter<?,A> adapter1,
A data1,
B data2,
int len)
Compute bivariate ranks.

q[i] is the number of objects such that x[j] < x[i] and y[j] < y[i]

Parameters:
adapter1 - First adapter
data1 - First data set
adapter2 - Second adapter
data2 - Second data set
len - Length
Returns:
Bivariate rank statistics.
• #### toPValue

public double toPValue(double d,
int n)
Convert Hoeffding D value to a p-value.
Parameters:
d - D value
n - Data set size
Returns:
p-value