/** * Computes the chi-squared similarity statistic, then uses that to compute * a cumulative probability. Returns the probability that a chi-squared * statistic falls between 0 and the critical value (the computed chi-squared * statistic for the two supplied vectors). Naturally, a large chi-squared * value generates a large cumulative probability value. * @return The probability of a chi-squared statistic being lower than the value of the chi-squared similarity of the given vectors. */ public double computeCumulativeProbabilityValue() { double chiSquaredStat = compute(); ChiSquareDistribution dist = new ChiSquareDistribution(categorizedVector.getDimensionality()-1); return dist.getCDF().evaluate(chiSquaredStat); }
/** * Computes the chi-squared similarity statistic, then uses that to compute * a cumulative probability. Returns the probability that a chi-squared * statistic falls between 0 and the critical value (the computed chi-squared * statistic for the two supplied vectors). Naturally, a large chi-squared * value generates a large cumulative probability value. * @return The probability of a chi-squared statistic being lower than the value of the chi-squared similarity of the given vectors. */ public double computeCumulativeProbabilityValue() { double chiSquaredStat = compute(); ChiSquareDistribution dist = new ChiSquareDistribution(categorizedVector.getDimensionality()-1); return dist.getCDF().evaluate(chiSquaredStat); }
/** * Computes the chi-squared similarity statistic, then uses that to compute * a cumulative probability. Returns the probability that a chi-squared * statistic falls between 0 and the critical value (the computed chi-squared * statistic for the two supplied vectors). Naturally, a large chi-squared * value generates a large cumulative probability value. * @return The probability of a chi-squared statistic being lower than the value of the chi-squared similarity of the given vectors. */ public double computeCumulativeProbabilityValue() { double chiSquaredStat = compute(); ChiSquareDistribution dist = new ChiSquareDistribution(categorizedVector.getDimensionality()-1); return dist.getCDF().evaluate(chiSquaredStat); }