Class MWPTest

  • All Implemented Interfaces:
    MCDETest<MWPTest.MWPRanking>

    @Reference(authors="E. Fouch\u00e9, K. B\u00f6hm",
               title="Monte Carlo Density Estimation",
               booktitle="Proc. Scientific and Statistical Database Management (SSDBM 2019)",
               url="https://doi.org/10.1145/3335783.3335795",
               bibkey="DBLP:conf/ssdbm/FoucheB19")
    public class MWPTest
    extends java.lang.Object
    implements MCDETest<MWPTest.MWPRanking>
    Implementation of Mann-Whitney U test returning the p-value (not the test statistic, thus MWP) for MCDEDependence. Implements algorithm 1 and 3 of reference paper.

    Reference:

    E. Fouché and K. Böhm
    Monte Carlo Density Estimation
    Proc. Scientific and Statistical Database Management (SSDBM 2019)

    Since:
    0.8.0
    Author:
    Alan Mazankiewicz, Edouard Fouché
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MWPTest.MWPRanking
      Structure to hold values needed for computing MWP in MCDEDependene.
      static class  MWPTest.Par
      Parameterizer, returning the static instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected RandomFactory rnd
      Random generator.
      static MWPTest STATIC
      Static Constructor - use this one
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MWPTest()
      Private Constructor - use STATIC
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <A> MWPTest.MWPRanking correctedRanks​(NumberArrayAdapter<?,​A> adapter, A data, int len)
      Compute the corrected rank index.
      protected int getSafeCut​(int idx, double[] ref)
      Adjusts idx so that it lies not in the middle of a tie by searching the ranks index
      double statisticalTest​(int start, int width, boolean[] slice, MWPTest.MWPRanking corrected_ranks)
      Efficient implementation of MWP statistical test using appropriate index structure as described in Algorithm 3 of reference paper.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STATIC

        public static final MWPTest STATIC
        Static Constructor - use this one
    • Constructor Detail

      • MWPTest

        private MWPTest()
        Private Constructor - use STATIC
    • Method Detail

      • statisticalTest

        public double statisticalTest​(int start,
                                      int width,
                                      boolean[] slice,
                                      MWPTest.MWPRanking corrected_ranks)
        Efficient implementation of MWP statistical test using appropriate index structure as described in Algorithm 3 of reference paper. Tailored to MCDE Framework.
        Specified by:
        statisticalTest in interface MCDETest<MWPTest.MWPRanking>
        Parameters:
        start - Starting index value for statistical test
        width - Width of the slice (endindex = start + width)
        slice - Return value of randomSlice() created with the index that is not for the reference dimension
        corrected_ranks - Index of the reference dimension, return value of correctedRanks() computed for reference dimension
        Returns:
        p-value from two sided Mann-Whitney-U test
      • getSafeCut

        protected int getSafeCut​(int idx,
                                 double[] ref)
        Adjusts idx so that it lies not in the middle of a tie by searching the ranks index
        Parameters:
        idx - starting index. In MCDE MWP the start and end of a slice
        ref - adjusted ranks
        Returns:
        adjusted idx