Skip to content

Commit

Permalink
fixed files form Math #65
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 4401e9f commit 2731d92
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,7 @@ protected void updateResidualsAndCost()
* @return RMS value
*/
public double getRMS() {
double criterion = 0;
for (int i = 0; i < rows; ++i) {
final double residual = residuals[i];
criterion += residual * residual * residualsWeights[i];
}
return Math.sqrt(criterion / rows);
return Math.sqrt(getChiSquare() / rows);
}

/**
Expand All @@ -255,7 +250,7 @@ public double getChiSquare() {
double chiSquare = 0;
for (int i = 0; i < rows; ++i) {
final double residual = residuals[i];
chiSquare += residual * residual / residualsWeights[i];
chiSquare += residual * residual * residualsWeights[i];
}
return chiSquare;
}
Expand Down

0 comments on commit 2731d92

Please sign in to comment.