Examples of LinearRegression


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

Examples of de.torstennahm.statistics.LinearRegression

      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

Examples of net.sourceforge.processdash.util.LinearRegression

                }
            } catch (NullPointerException e) {}
            if (minX == maxX) {
                if (maxX > 0) minX = 0; else maxX = 0;
            }
            resetLine(new LinearRegression(data), minX, maxX);
        }
View Full Code Here

Examples of net.sourceforge.processdash.util.LinearRegression

    }

    public void calc() {
        Vector dataPoints = histData.getXYDataPoints(xColumn, yColumn);

        LinearRegression l = new LinearRegression(dataPoints);
        this.rangePercent = RANGE_PERCENT;
        l.project(this.inputValue, this.rangePercent);

        this.beta0 = l.beta0;
        this.beta1 = l.beta1;
        this.outputValue = l.projection;
        this.outputRange = l.range;
View Full Code Here

Examples of org.encog.ml.fitting.linear.LinearRegression

  public void testLinear1() {
    double[][] INPUT = { {3}, {6}, {4}, {5} };
    double[][] IDEAL = { {0}, {-3}, {-1}, {-2} };
   
    MLDataSet data = new BasicMLDataSet(INPUT,IDEAL);
    LinearRegression lin = new LinearRegression(1);
    TrainLinearRegression train = new TrainLinearRegression(lin,data);
    train.iteration();
   
    System.out.println("w0 = " + Format.formatDouble(lin.getWeights()[0],2));
    System.out.println("w1 = " + Format.formatDouble(lin.getWeights()[1],2));
    System.out.println("Error: " + lin.calculateError(data));
  }
View Full Code Here

Examples of org.encog.ml.fitting.linear.LinearRegression

  public void testLinear2() {
    double[][] INPUT = { {2}, {4}, {6}, {8} };
    double[][] IDEAL = { {2}, {5}, {5}, {8} };
   
    MLDataSet data = new BasicMLDataSet(INPUT,IDEAL);
    LinearRegression lin = new LinearRegression(1);
    TrainLinearRegression train = new TrainLinearRegression(lin,data);
    train.iteration();
    System.out.println("w0 = " + Format.formatDouble(lin.getWeights()[0],2));
    System.out.println("w1 = " + Format.formatDouble(lin.getWeights()[1],2));
    System.out.println("Error: " + lin.calculateError(data));
  }
View Full Code Here

Examples of pspdash.data.LinearRegression

                }
            } catch (NullPointerException e) {}
            if (minX == maxX) {
                if (maxX > 0) minX = 0; else maxX = 0;
            }
            resetLine(new LinearRegression(data), minX, maxX);
        }
View Full Code Here

Examples of pspdash.data.LinearRegression

                           int xCol, int yCol,
                           String letter, String purpose) {
        super(data, estObjLOC, letter, purpose);

        Vector dataPoints = data.getXYDataPoints(xCol, yCol);
        l = new LinearRegression(dataPoints);

        if (l.x_avg == 0 || badDouble(l.x_avg) || badDouble(l.y_avg)) {
            errorMessages.add("You do not have enough historical data.");
            rating = CANNOT_CALCULATE;
            return;
View Full Code Here

Examples of pspdash.data.LinearRegression

                           int xCol, int yCol,
                           String letter, String purpose) {
        super(data, estObjLOC, letter, purpose);

        Vector dataPoints = data.getXYDataPoints(xCol, yCol);
        l = new LinearRegression(dataPoints);
        c = new Correlation(dataPoints);

        if (dataPoints.size() < 3 ||
            badDouble(l.beta0) || badDouble(l.beta1) ||
            badDouble(c.r) || badDouble(c.p)) {
View Full Code Here

Examples of trust.jfcm.learning.training.LinearRegression

    System.out.println(dataset);
   
   
   
    map.setTrainingSet(dataset);
    trainer = new LinearRegression(map);
    trainer.train();
   
    map.resetConcepts();
   
    System.out.println("\n ********* Computing trust for Pediatrician AFTER training **********\n");
 
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.