Examples of TDistribution

@version $Revision: 920852 $ $Date: 2010-03-09 13:53:44 +0100 (mar. 09 mars 2010) $
  • org.apache.commons.math3.distribution.TDistribution
    pedia.org/wiki/Student's_t-distribution'>Student's t-distribution (Wikipedia)" @see "Student's t-distribution (MathWorld)"

  • Examples of org.apache.commons.math3.distribution.TDistribution

         * Verify that direct t-tests using standard error estimates are consistent
         * with reported p-values
         */
        @Test
        public void testStdErrorConsistency() throws Exception {
            TDistribution tDistribution = new TDistribution(45);
            RealMatrix matrix = createRealMatrix(swissData, 47, 5);
            PearsonsCorrelation corrInstance = new PearsonsCorrelation(matrix);
            RealMatrix rValues = corrInstance.getCorrelationMatrix();
            RealMatrix pValues = corrInstance.getCorrelationPValues();
            RealMatrix stdErrors = corrInstance.getCorrelationStandardErrors();
            for (int i = 0; i < 5; i++) {
                for (int j = 0; j < i; j++) {
                    double t = FastMath.abs(rValues.getEntry(i, j)) / stdErrors.getEntry(i, j);
                    double p = 2 * (1 - tDistribution.cumulativeProbability(t));
                    Assert.assertEquals(p, pValues.getEntry(i, j), 10E-15);
                }
            }
        }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.