Class MWPTest
- java.lang.Object
-
- elki.math.statistics.dependence.mcde.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) forMCDEDependence. 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 classMWPTest.MWPRankingStructure to hold values needed for computing MWP in MCDEDependene.static classMWPTest.ParParameterizer, returning the static instance.-
Nested classes/interfaces inherited from interface elki.math.statistics.dependence.mcde.MCDETest
MCDETest.RankStruct
-
-
Field Summary
Fields Modifier and Type Field Description protected RandomFactoryrndRandom generator.static MWPTestSTATICStatic Constructor - use this one
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A> MWPTest.MWPRankingcorrectedRanks(NumberArrayAdapter<?,A> adapter, A data, int len)Compute the corrected rank index.protected intgetSafeCut(int idx, double[] ref)Adjusts idx so that it lies not in the middle of a tie by searching the ranks indexdoublestatisticalTest(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.
-
-
-
Field Detail
-
STATIC
public static final MWPTest STATIC
Static Constructor - use this one
-
rnd
protected RandomFactory rnd
Random generator.
-
-
Constructor Detail
-
MWPTest
private MWPTest()
Private Constructor - useSTATIC
-
-
Method Detail
-
correctedRanks
public <A> MWPTest.MWPRanking correctedRanks(NumberArrayAdapter<?,A> adapter, A data, int len)
Description copied from interface:MCDETestCompute the corrected rank index.- Specified by:
correctedRanksin interfaceMCDETest<MWPTest.MWPRanking>- Type Parameters:
A- Input array type- Parameters:
adapter- Array-like adapterdata- Data objectlen- Length- Returns:
- corrected ranks
-
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:
statisticalTestin interfaceMCDETest<MWPTest.MWPRanking>- Parameters:
start- Starting index value for statistical testwidth- Width of the slice (endindex = start + width)slice- Return value of randomSlice() created with the index that is not for the reference dimensioncorrected_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 sliceref- adjusted ranks- Returns:
- adjusted idx
-
-