Java Code Examples for org.apache.commons.math3.stat.ranking.TiesStrategy#AVERAGE

The following examples show how to use org.apache.commons.math3.stat.ranking.TiesStrategy#AVERAGE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MatrixTools.java    From systemsgenetics with GNU General Public License v3.0 5 votes vote down vote up
public static void rankColumns(DoubleMatrix2D matrix) {
    RankingAlgorithm COV_RANKER_TIE = new NaturalRanking(NaNStrategy.FAILED, TiesStrategy.AVERAGE);
    
    for (int c = 0; c < matrix.columns(); c++) {
        double[] rank = COV_RANKER_TIE.rank(matrix.viewColumn(c).toArray());
        for (int r = 0; r < matrix.rows(); r++) {
            matrix.set(r, c, (rank[r]));
        }
    }
}
 
Example 2
Source File: DoubleMatrixDataset.java    From systemsgenetics with GNU General Public License v3.0 3 votes vote down vote up
public DoubleMatrixDataset<R, C> createRowForceNormalDuplicate() {

		DoubleMatrixDataset<R, C> newDataset = new DoubleMatrixDataset<>(hashRows, hashCols);

		NaturalRanking ranking = new NaturalRanking(NaNStrategy.FAILED,
				TiesStrategy.AVERAGE);

		for (int r = 0; r < matrix.rows(); ++r) {

			double[] row = matrix.viewRow(r).toArray();

			double mean = JSci.maths.ArrayMath.mean(row);
			double stdev = JSci.maths.ArrayMath.standardDeviation(row);

			double[] rankedValues = ranking.rank(row);

			for (int s = 0; s < matrix.columns(); s++) {
				double pValue = (0.5d + rankedValues[s] - 1d) / (double) (rankedValues.length);

				newDataset.setElementQuick(r, s, mean + cern.jet.stat.Probability.normalInverse(pValue) * stdev);
			}

		}

		return newDataset;

	}
 
Example 3
Source File: MannWhitneyUTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 4
Source File: Elixir_0022_t.java    From coming with MIT License 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 5
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 6
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 7
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 8
Source File: MannWhitneyUTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 9
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 10
Source File: MannWhitneyUTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 11
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 12
Source File: MannWhitneyUTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 13
Source File: MannWhitneyUTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 14
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 15
Source File: MannWhitneyUTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 16
Source File: WilcoxonSignedRankTest.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a test instance where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure
 * of what you are doing.
 */
public WilcoxonSignedRankTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 17
Source File: patchedMannWhitneyUTest.java    From coming with MIT License 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 18
Source File: buggyMannWhitneyUTest.java    From coming with MIT License 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 19
Source File: Math_30_MannWhitneyUTest_t.java    From coming with MIT License 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}
 
Example 20
Source File: Elixir_0022_s.java    From coming with MIT License 2 votes vote down vote up
/**
 * Create a test instance using where NaN's are left in place and ties get
 * the average of applicable ranks. Use this unless you are very sure of
 * what you are doing.
 */
public MannWhitneyUTest() {
    naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
            TiesStrategy.AVERAGE);
}