Package de.torstennahm.statistics

Examples of de.torstennahm.statistics.LinearRegression


  private void doRegression() {
    errorSlope = Double.NaN;
    errorStart = Double.NaN;
   
    if (currentPoints > 1000) {
      LinearRegression reg = new LinearRegression();
      double logCurrentPoints = Math.log(currentPoints);
     
      for (LogEntry entry : log) {
        double logPoints = Math.log(entry.points);
        if (logPoints >= 0.5 * logCurrentPoints && logPoints <= 0.75 * logCurrentPoints) {
          reg.add(logPoints, Math.log(entry.variation()));
        }
      }
       
      errorSlope = reg.slope();
      errorStart = reg.yIntercept();
    }
  }
View Full Code Here


      double slope = (Math.log(entry2.variation()) - Math.log(entry1.variation())) /
               (Math.log(entry2.points) - Math.log(entry1.points));
      double currErr = entry2.variation() * Math.pow(currentPoints / entry1.points, slope);
     
      if (entry1 != null && entry2 != null) {
        LinearRegression reg = null;
       
        for (int i = 0; i < ZERO_IN_ITERATIONS; i++) {
          reg = new LinearRegression();
         
          for (LogEntry entry : log) {
            if (entry.variation() > currErr * 20 && entry.variation() < currErr * 1000) {
              reg.add(Math.log(entry.points), Math.log(entry.variation()));
            }
          }
        }
       
        errorSlope = reg.slope();
        errorStart = reg.yIntercept();
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.torstennahm.statistics.LinearRegression

Copyright © 2018 www.massapicom. 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.