switch (alternativeHypothesis) { case GREATER_THAN: return 1 - distribution.cumulativeProbability(numberOfSuccesses - 1); case LESS_THAN: return distribution.cumulativeProbability(numberOfSuccesses); case TWO_SIDED: int criticalValueLow = 0;
/** Calculate a p-value for Fisher's Exact Test. */ private double test(int a, int b, int c, int d) { BinomialDistribution dist = new BinomialDistribution(b + c, 0.5); double pValue = dist.cumulativeProbability(c); return pValue; }
/** * get a peptide score based on peakDepth. */ public double getScore(ProductIonSet productIonSet, int peakDepth, int splitSize) { List<PeakSet> depthPeakSetList = getDepthPeakSetList(peakDepth, splitSize); PeakSet allDepthPeakSet = new PeakSet(); for (PeakSet depthPeakSet : depthPeakSetList) { allDepthPeakSet.addAll(depthPeakSet); } ProductIonSet matchedSet = getMatchedSet(productIonSet, allDepthPeakSet); int N = productIonSet.size(); int n = matchedSet.size(); double p = getProbability(peakDepth, splitSize); BinomialDistribution distribution = new BinomialDistribution(N, p); // get cumulative probability which n-1 < x <= N, that means n <= x <= N double cumulative = distribution.cumulativeProbability(n-1, N); return (-10) * Math.log10(cumulative); }
/** * get a peptide score based on peakDepth. */ public double getScore(ProductIonSet productIonSet, int peakDepth, int splitSize) { List<PeakSet> depthPeakSetList = getDepthPeakSetList(peakDepth, splitSize); PeakSet allDepthPeakSet = new PeakSet(); for (PeakSet depthPeakSet : depthPeakSetList) { allDepthPeakSet.addAll(depthPeakSet); } ProductIonSet matchedSet = getMatchedSet(productIonSet, allDepthPeakSet); int N = productIonSet.size(); int n = matchedSet.size(); double p = getProbability(peakDepth, splitSize); BinomialDistribution distribution = new BinomialDistribution(N, p); // get cumulative probability which n-1 < x <= N, that means n <= x <= N double cumulative = distribution.cumulativeProbability(n-1, N); return (-10) * Math.log10(cumulative); }
@Override public final void compute() { if (input[0].isDefined() && input[1].isDefined() && input[2].isDefined() && input[3].isDefined()) { int param = (int) Math.round(a.getDouble()); double param2 = b.getDouble(); int val = (int) Math.round(c.getDouble()); try { BinomialDistribution dist = getBinomialDistribution(param, param2); if (isCumulative.getBoolean()) { num.setValue(dist.cumulativeProbability(val)); // P(X <= // val) } else { num.setValue(dist.probability(val)); // P(X = val) } } catch (Exception e) { Log.debug(e.getMessage()); num.setUndefined(); } } else { num.setUndefined(); } }
switch (alternativeHypothesis) { case GREATER_THAN: return 1 - distribution.cumulativeProbability(numberOfSuccesses - 1); case LESS_THAN: return distribution.cumulativeProbability(numberOfSuccesses); case TWO_SIDED: int criticalValueLow = 0;
switch (alternativeHypothesis) { case GREATER_THAN: return 1 - distribution.cumulativeProbability(numberOfSuccesses - 1); case LESS_THAN: return distribution.cumulativeProbability(numberOfSuccesses); case TWO_SIDED: int criticalValueLow = 0;
switch (alternativeHypothesis) { case GREATER_THAN: return 1 - distribution.cumulativeProbability(numberOfSuccesses - 1); case LESS_THAN: return distribution.cumulativeProbability(numberOfSuccesses); case TWO_SIDED: int criticalValueLow = 0;