Examples of OneWayAnovaImpl


Examples of org.apache.commons.math.stat.inference.OneWayAnovaImpl

    return res;
  }
 
  public IValue anovaFValue(IList categoryData){
    try {
      return values.real(new OneWayAnovaImpl().anovaFValue(makeAnova(categoryData)));
    } catch (IllegalArgumentException e) {
      throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage());
    } catch (MathException e) {
      throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage());
    }
View Full Code Here

Examples of org.apache.commons.math.stat.inference.OneWayAnovaImpl

    }
  }
 
  public IValue anovaPValue(IList categoryData){
    try {
      return values.real(new OneWayAnovaImpl().anovaPValue(makeAnova(categoryData)));
    } catch (IllegalArgumentException e) {
      throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage());
    } catch (MathException e) {
      throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage());
    }
View Full Code Here

Examples of org.apache.commons.math.stat.inference.OneWayAnovaImpl

    }
  }
 
  public IValue anovaTest(IList categoryData, INumber alpha){
    try {
      return values.bool(new OneWayAnovaImpl().anovaTest(makeAnova(categoryData), alpha.toReal().doubleValue()));
    } catch (IllegalArgumentException e) {
      throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage());
    } catch (MathException e) {
      throw RuntimeExceptionFactory.illegalArgument(categoryData, null, null, e.getMessage());
    }
View Full Code Here

Examples of org.apache.commons.math.stat.inference.OneWayAnovaImpl

  }

  // ANOVA test with raw eps aur data.
  public void testRawEpsAurAnova() {
    List<double[]> bins = getBins(10, jdMagData);
    OneWayAnova anova = new OneWayAnovaImpl();

    try {
      double fValue = anova.anovaFValue(bins);
      assertEquals("2.91", String.format("%2.2f", fValue));

      double pValue = anova.anovaPValue(bins);
      assertEquals("0.000002", String.format("%1.6f", pValue));

      boolean rejectNullHypothesis = anova.anovaTest(bins, 0.05);
      assertTrue(rejectNullHypothesis);
    } catch (MathException e) {
      System.err.println(e.getMessage());
      fail();
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.commons.math.stat.inference.OneWayAnovaImpl

    List<double[]> data = new ArrayList<double[]>();
    data.add(a1);
    data.add(a2);
    data.add(a3);

    OneWayAnova anova = new OneWayAnovaImpl();

    try {
      // 9.264705882352942
      double fValue = anova.anovaFValue(data);
      assertEquals("9.26", String.format("%1.2f", fValue));

      // 0.002398777329392865
      double pValue = anova.anovaPValue(data);
      assertEquals("0.002", String.format("%1.3f", pValue));

      // alpha value can be 0 < alpha <= 0.5
      boolean rejectNullHypothesis = anova.anovaTest(data, 0.1);
      assertTrue(rejectNullHypothesis);
    } catch (MathException e) {
      System.err.println(e.getMessage());
      fail();
    }
View Full Code Here

Examples of org.apache.commons.math.stat.inference.OneWayAnovaImpl

    this.sourceObsCount = sourceObsCount;
    this.meanObservations = meanObservations;
    this.magnitudeBins = magnitudeBins;
    this.error = false;

    OneWayAnova anova = new OneWayAnovaImpl();
    try {
      fValue = anova.anovaFValue(this.magnitudeBins);
      pValue = anova.anovaPValue(this.magnitudeBins);
    } catch (Exception e) {
      error = true;
      fValue = Double.NaN;
      pValue = Double.NaN;
    }
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.