Changeset 9713 for branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LinearLeastSquaresFitting.cs
- Timestamp:
- 07/17/13 13:32:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LinearLeastSquaresFitting.cs
r9706 r9713 52 52 } 53 53 54 //TODO: adapt or remove 55 public double CalculateError(double[] dataPoints, double a1, double a0) { 54 public double CalculateError(double[] dataPoints, double p0, double p1) { 56 55 double r = 0.0; 57 56 double avgy = dataPoints.Average(); … … 60 59 61 60 for (int i = 0; i < dataPoints.Count(); i++) { 62 double y = a1 * i + a0;61 double y = p0 * i + p1; 63 62 sstot += Math.Pow(dataPoints[i] - avgy, 2); 64 63 sserr += Math.Pow(dataPoints[i] - y, 2);
Note: See TracChangeset
for help on using the changeset viewer.