Class PearsonCorrelationDependence

  • All Implemented Interfaces:
    Dependence

    @Priority(201)
    public class PearsonCorrelationDependence
    extends java.lang.Object
    implements Dependence
    Pearson product-moment correlation coefficient.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Constructor Detail

      • PearsonCorrelationDependence

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

      • dependence

        public <A,​B> double dependence​(NumberArrayAdapter<?,​A> adapter1,
                                             A data1,
                                             NumberArrayAdapter<?,​B> adapter2,
                                             B data2)
        Description copied from interface: Dependence
        Measure the dependence of two variables.

        This is the more flexible API, which allows using different internal data representations.

        Specified by:
        dependence in interface Dependence
        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
      • dependence

        public <A> double[] dependence​(NumberArrayAdapter<?,​A> adapter,
                                       java.util.List<? extends A> data)
        Description copied from interface: Dependence
        Measure the dependence of two variables.

        This is the more flexible API, which allows using different internal data representations.

        The resulting data is a serialized lower triangular matrix:

          X  S  S  S  S  S
          0  X  S  S  S  S
          1  2  X  S  S  S
          3  4  5  X  S  S
          6  7  8  9  X  S
         10 11 12 13 14  X
         
        Specified by:
        dependence in interface Dependence
        Type Parameters:
        A - Array type
        Parameters:
        adapter - Data adapter
        data - Data sets. Must have fast random access!
        Returns:
        Lower triangular serialized matrix