AbstractLeastSquaresOptimizer extends JacobianMultivariateVectorOptimizer { public double getRMS() { return FastMath.sqrt(getChiSquare() / getTargetSize()); } protected  AbstractLeastSquaresOptimizer(ConvergenceChecker<PointVectorValuePair> checker); double getRMS(); double getChiSquare(); RealMatrix getWeightSquareRoot(); double[][] computeCovariances(double[] params,
                                         double threshold); double[] computeSigma(double[] params,
                                 double covarianceSingularityThreshold); @Override PointVectorValuePair optimize(OptimizationData... optData);  }
@Test public void testGetRMS() throws IOException { final StatisticalReferenceDataset dataset = StatisticalReferenceDatasetFactory.createKirby2(); final AbstractLeastSquaresOptimizer optimizer = createOptimizer(); final double[] a = dataset.getParameters(); final double[] y = dataset.getData()[1]; final double[] w = new double[y.length]; Arrays.fill(w, 1); StatisticalReferenceDataset.LeastSquaresProblem problem = dataset.getLeastSquaresProblem(); optimizer.optimize(new MaxEval(1), problem.getModelFunction(), problem.getModelFunctionJacobian(), new Target(y), new Weight(w), new InitialGuess(a)); final double expected = FastMath .sqrt(dataset.getResidualSumOfSquares() / dataset.getNumObservations()); final double actual = optimizer.getRMS(); Assert.assertEquals(dataset.getName(), expected, actual, 1E-11 * expected); }