Checks the Critical Value to determine if the Hypothesis should be rejected

@param score
@param is_twoTailed
@param aLevel
@return
962588
private static boolean checkCriticalValue(double score, boolean is_twoTailed, double aLevel) {
        double probability = ContinuousDistributions.gaussCdf(score);
        
        boolean rejectH0=false;
        
        double a=aLevel;
        if(is_twoTailed) { //if to tailed test then split the statistical significance in half
            a=aLevel/2.0;
        }
        if(probability<=a || probability>=(1.0-a)) {
            rejectH0=true;
        }
        
        return rejectH0;
    }
645967
public static int isValid( DMatrixRMaj cov ) {
        if( !MatrixFeatures_DDRM.isDiagonalPositive(cov) )
            return 1;

        if( !MatrixFeatures_DDRM.isSymmetric(cov,TOL) )
            return 2;

        if( !MatrixFeatures_DDRM.isPositiveSemidefinite(cov) )
            return 3;

        return 0;
    }
271701
private static void checkAndCorrect(final double[] probabilities) {
		boolean ok = true;
		for (int i = probabilities.length; --i >= 0 && ok;) {
			ok = Double.isFinite(probabilities[i]);
		}

		if (!ok) {
			final double value = 1.0/probabilities.length;
			for (int i = probabilities.length; --i >= 0;) {
				probabilities[i] = value;
			}
		}
	}
1282488
public double score(StringWrapper s, StringWrapper t) {
	String S = s.unwrap(),
	  T =t.unwrap();
    totalScore = 0.0;
    if (S.equals(T)) {
      matched = S.length();
      return 1.0;
    }
    else {
      sSize = S.length();
      tSize = T.length();
      // let S be the largest token
      if (sSize < tSize) {
        String tmp1 = S;
        S = T;
        T = tmp1;
        double tmp2 = sSize;
        sSize = tSize;
        tSize = tmp2;
        tokenT = T;
      }
      tokenT = S;
      ArrayList candidateList = algorithm1(S, T);
      sortList(candidateList);
      totalScore = getScore(candidateList);
      totalScore = (totalScore / ( (double) sSize) + totalScore / ( (double) tSize)) / 2.0;
      return winkler(totalScore, S, T);
    }
  }
689699
public static boolean checkCriticalValue(double score, int n, int k, boolean is_twoTailed, double aLevel) {
        /*
        if(n<=200 && k<=20) {
            //Calculate it from tables
            //http://www3.nd.edu/~wevans1/econ30331/Durbin_Watson_tables.pdf
        }
        */
        
        //Follows normal distribution for large samples
        //References: http://econometrics.com/guide/dwdist.htm
        double z=(score-2.0)/Math.sqrt(4.0/n);

        double probability=ContinuousDistributions.gaussCdf(z);

        boolean rejectH0=false;

        double a=aLevel;
        if(is_twoTailed) { //if to tailed test then split the statistical significance in half
            a=aLevel/2.0;
        }
        if(probability<=a || probability>=(1-a)) {
            rejectH0=true;
        }

        return rejectH0;
    }
1263664
double evaluateBy(ScoreEvaluation eval) {
    return eval.evaluate(new DBIDsTest(DBIDUtil.ensureSet(scores.getDBIDs())), new OutlierScoreAdapter(this));
  }
1027427
double scoreResults() {

		double totalScore = 0;

		for (int i = 0; i < normalizedP.size; i++) {
			DMatrixRMaj P = normalizedP.get(i);
			MultiViewOps.intrinsicFromAbsoluteQuadratic(Q,P,intrinsic);

			double score = 0;

			// skew should be zero
			score += w_sk*Math.abs(intrinsic.skew);
			// aspect ratio unity
			score += w_ar*(Math.max(intrinsic.fx,intrinsic.fy)/Math.min(intrinsic.fx,intrinsic.fy) - 1);
			// principle point zero
			score += w_uo*(Math.abs(intrinsic.cx) + Math.abs(intrinsic.cy));

			totalScore += score;
		}
		return totalScore;
	}
1239655
public Optional<FMeasureInfo> score(final Iterable<? extends Iterable<?>> predicted,
      final Iterable<? extends Iterable<?>> gold) {
    final List<Set<Object>> predictedAsSets = CorefScorerUtils.toSets(predicted);
    final List<Set<Object>> goldAsSets = CorefScorerUtils.toSets(gold);

    final Map<Object, Set<Object>> predictedItemToGroup =
        CollectionUtils.makeElementsToContainersMap(predictedAsSets);
    final Map<Object, Set<Object>> goldItemToGroup =
        CollectionUtils.makeElementsToContainersMap(goldAsSets);

    CorefScorerUtils.checkPartitionsOverSameElements(predictedItemToGroup.keySet(),
        goldItemToGroup.keySet());

    final Optional<Float> recall =
        mucScoreComponent(goldAsSets, predictedAsSets, predictedItemToGroup);
    final Optional<Float> precision =
        mucScoreComponent(predictedAsSets, goldAsSets, goldItemToGroup);

    if (recall.isPresent() && precision.isPresent()) {
      // why are these floats?
      return Optional.<FMeasureInfo>of(new PrecisionRecallPair(precision.get(), recall.get()));
    } else {
      return Optional.absent();
    }
  }
1264653
function areScenesShallowEqual(one, two) {
  return (
    one.key === two.key &&
    one.index === two.index &&
    one.isStale === two.isStale &&
    one.isActive === two.isActive &&
    areRoutesShallowEqual(one.route, two.route)
  );
}
331987
public static EdgeScores insideOutsideO2AllGraMultiRoot(DependencyScorer scorer, Algebra s) {
        return insideOutside02AllGra(scorer, s, false);
    }
335102
public function equals(Score $score): bool
    {
        if (null !== $this->scaled xor null !== $score->scaled) {
            return false;
        }

        if ((float) $this->scaled !== (float) $score->scaled) {
            return false;
        }

        if (null !== $this->raw xor null !== $score->raw) {
            return false;
        }

        if ((float) $this->raw !== (float) $score->raw) {
            return false;
        }

        if (null !== $this->min xor null !== $score->min) {
            return false;
        }

        if ((float) $this->min !== (float) $score->min) {
            return false;
        }

        if (null !== $this->max xor null !== $score->max) {
            return false;
        }

        if ((float) $this->max !== (float) $score->max) {
            return false;
        }

        return true;
    }
798393
public void validate() {
        // AutoResetToZero
        if (niceMinValue > 0 || niceMaxValue < 0) {
            autoResetToZero = false;
        }

        // Threshold
        if (threshold < niceMinValue || threshold > niceMaxValue) {
            threshold = niceMaxValue;
        }

        // MinMeasuredValue
        if (minMeasuredValue < niceMinValue || minMeasuredValue > niceMaxValue) {
            minMeasuredValue = value;
        }

        // MaxMeasuredValue
        if (maxMeasuredValue > niceMaxValue || maxMeasuredValue < niceMinValue) {
            maxMeasuredValue = value;
        }

        // PeakValue
        if (peakValue < niceMinValue || peakValue > niceMaxValue) {
            peakValue = value;
        }

        // TrackStart
        if (Double.compare(trackStart, niceMinValue) <= 0 || Double.compare(trackStart, niceMaxValue) >= 0 || Double.compare(trackStart, trackStop) >= 0) {
            trackStart = niceMinValue;
        }

        // TrackStop
        if ((Double.compare(trackStop, niceMinValue)) <= 0 || Double.compare(trackStop, niceMaxValue) >= 0 || Double.compare(trackStop, trackStart) <= 0) {
            trackStop = niceMaxValue;
        }

        // TrackSection
        if (Double.compare(trackSection, niceMinValue) <= 0 || Double.compare(trackSection, niceMaxValue) >= 0 || Double.compare(trackSection, trackStart) <= 0 || Double.compare(trackSection, trackStop) >= 0) {
            trackSection = ((trackStart + (trackStop - trackStart) / 2.0));
        }

        // Areas
        for (Section area : areas) {
            if ((area.getStart() < niceMinValue) || Double.compare(area.getStart(), niceMaxValue) >= 0 || Double.compare(area.getStart(), area.getStop()) >= 0) {
                area.setStart(niceMinValue);
            }

            if (area.getStop() < niceMinValue || area.getStop() > niceMaxValue || Double.compare(area.getStop(), area.getStart()) <= 0) {
                area.setStop(niceMaxValue);
            }

            if (Double.compare(area.getStart(), minValue) == 0) {
                area.setStart(niceMinValue);
            }

            if (Double.compare(area.getStop(), maxValue) == 0) {
                area.setStop(niceMaxValue);
            }
        }

        // Sections
        for (Section section : sections) {
            if ((section.getStart() < niceMinValue) || Double.compare(section.getStart(), niceMaxValue) >= 0 || Double.compare(section.getStart(), section.getStop()) >= 0) {
                section.setStart(niceMinValue);
            }

            if (section.getStop() < niceMinValue || section.getStop() > niceMaxValue || Double.compare(section.getStop(), section.getStart()) <= 0) {
                section.setStop(niceMaxValue);
            }

            if (Double.compare(section.getStart(), minValue) == 0) {
                section.setStart(niceMinValue);
            }

            if (Double.compare(section.getStop(), maxValue) == 0) {
                section.setStop(niceMaxValue);
            }
        }

        // TickmarkSections
        for (Section tickmarkSection : tickmarkSections) {
            if ((tickmarkSection.getStart() < niceMinValue) || Double.compare(tickmarkSection.getStart(), niceMaxValue) >= 0 || Double.compare(tickmarkSection.getStart(), tickmarkSection.getStop()) >= 0) {
                tickmarkSection.setStart(niceMinValue);
            }

            if (tickmarkSection.getStop() < niceMinValue || tickmarkSection.getStop() > niceMaxValue || Double.compare(tickmarkSection.getStop(), tickmarkSection.getStart()) <= 0) {
                tickmarkSection.setStop(niceMaxValue);
            }

            if (Double.compare(tickmarkSection.getStart(), minValue) == 0) {
                tickmarkSection.setStart(niceMinValue);
            }

            if (Double.compare(tickmarkSection.getStop(), maxValue) == 0) {
                tickmarkSection.setStop(niceMaxValue);
            }
        }

        // Recalculate the redrawTolerance
        redrawFactor = redrawTolerance * getRange();

        // Correct the value (needed for init with negative minValue)
        value = value < niceMinValue ? niceMinValue : (value > niceMaxValue ? niceMaxValue : value);
    }
429257
private boolean processStepResults(double fx_candidate, double actualReduction, double predictedReduction) {
		double ratio = actualReduction/predictedReduction;
		boolean accepted;

		// Accept the new state if the score improved
		if( fx_candidate < fx ) {
			// reduce the amount of dampening.  Magic equation from [1].  My attempts to improve
			// upon it have failed.  It is truly magical.
			lambda = lambda* max(1.0/3.0, 1.0-Math.pow(2.0*ratio-1.0,3.0));
			nu=NU_INITIAL;
			accepted = true;
		} else {
			lambda *= nu;
			nu *= 2;
			accepted = false;
		}

		if( UtilEjml.isUncountable(lambda) || UtilEjml.isUncountable(nu) )
			throw new OptimizationException("BUG! lambda="+lambda+"  nu="+nu);

		if( accepted ) {
			boolean converged = checkConvergenceFTest(fx_candidate,fx);
			if( verbose != null ) {
				double length_p = NormOps_DDRM.normF(p); // TODO compute elsewhere ?
				verbose.printf("%-4d  %9.3E  %10.3E  %9.3E  %9.3E  %9.3E  %6.3f   %6.2E\n",
						totalSelectSteps, fx_candidate, fx_candidate - fx,length_p,ftest_val,gtest_val, ratio, lambda);
				if( converged ) {
					verbose.println("Converged f-test");
				}
			}

			acceptNewState(fx_candidate);
			return maximumLambdaNu() || converged;
		} else
			return false;
	}
199794
public static double score(ComputationGraph model, MultiDataSetIterator testData, boolean average) {
        //TODO: do this properly taking into account division by N, L1/L2 etc
        double sumScore = 0.0;
        int totalExamples = 0;
        while (testData.hasNext()) {
            MultiDataSet ds = testData.next();
            long numExamples = ds.getFeatures(0).size(0);
            sumScore += numExamples * model.score(ds);
            totalExamples += numExamples;
        }

        if (!average)
            return sumScore;
        return sumScore / totalExamples;
    }
1091759
static BLANCResult fromSetCounts(boolean itemSetsMatch, double corefLinksInBoth,
      double corefLinksInKey, double corefLinksInResponse, double nonCorefLinksInBoth,
      double nonCorefLinksInKey, double nonCorefLinksInResponse)
  {
    final double R_C = corefLinksInBoth / ((double) corefLinksInKey);
    final double P_C = corefLinksInBoth / ((double) corefLinksInResponse);
    final double R_N = nonCorefLinksInBoth / ((double) nonCorefLinksInKey);
    final double P_N = nonCorefLinksInBoth / ((double) nonCorefLinksInResponse);

    double blancScore;

    // this way of computing handles certain edge cases the P and R way does not
    final double F_C = 2*corefLinksInBoth/(corefLinksInKey+corefLinksInResponse);
    final double F_N = 2*nonCorefLinksInBoth/(nonCorefLinksInKey+nonCorefLinksInResponse);

    // handle special cases - section 4.1 of Luo et al.
    final boolean noCorefLinksOnEitherSide = corefLinksInKey == 0.0 && corefLinksInResponse == 0.0;
    final boolean noNonCorefLinksOnEitherSide =
        nonCorefLinksInKey == 0.0 && nonCorefLinksInResponse == 0.0;
    if (noCorefLinksOnEitherSide && noNonCorefLinksOnEitherSide) {
      // only a single item on both sides
      // is it the same?
      if (itemSetsMatch) {
        blancScore = 1.0;
      } else {
        blancScore = 0.0;
      }
    } else if (noCorefLinksOnEitherSide) {
      // only singletons on both sides
      blancScore = F_N;
    } else if (noNonCorefLinksOnEitherSide) {
      // both sides have one big cluster
      blancScore = F_C;
    } else {
      blancScore = 0.5*(F_N+F_C);
    }

    return new BLANCResult(P_C, P_N, R_C, R_N, F_C, F_N, blancScore);
  }
886823
private static boolean checkCriticalValue(double score, int df, boolean is_twoTailed, double aLevel) {
        double probability=ContinuousDistributions.studentsCdf(score,df);

        boolean rejectH0=false;

        double a=aLevel;
        if(is_twoTailed) { //if to tailed test then split the statistical significance in half
            a=aLevel/2;
        }
        if(probability<=a || probability>=(1-a)) {
            rejectH0=true;
        }

        return rejectH0;
    }
949358
private boolean isValidSentiment(final String type, final Double score, final Integer mixed) {
    return !StringUtils.isBlank(type)
           || score != null
           || mixed != null;
  }