Example usage for org.apache.commons.math3.distribution FDistribution probability

List of usage examples for org.apache.commons.math3.distribution FDistribution probability

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution FDistribution probability.

Prototype

public double probability(double x) 

Source Link

Usage

From source file:org.asoem.greyfish.utils.math.statistics.DefaultFTest.java

DefaultFTest(final double[] sample1, final double[] sample2) {
    final double variance1 = StatUtils.variance(sample1);
    final double variance2 = StatUtils.variance(sample2);

    this.numeratorDegreesOfFreedom = sample1.length - 1;
    this.denominatorDegreesOfFreedom = sample2.length - 1;
    final FDistribution fDistribution = new FDistribution(numeratorDegreesOfFreedom,
            denominatorDegreesOfFreedom);
    this.ratio = variance2 / variance1;
    this.p = 2 * (1 - fDistribution.probability(ratio));
}