AbstractLeastSquaresOptimizer extends BaseAbstractMultivariateVectorOptimizer<DifferentiableMultivariateVectorFunction> implements DifferentiableMultivariateVectorOptimizer { public double getChiSquare() { return cost * cost; } @Deprecated protected  AbstractLeastSquaresOptimizer(); protected  AbstractLeastSquaresOptimizer(ConvergenceChecker<PointVectorValuePair> checker); int getJacobianEvaluations(); double getRMS(); double getChiSquare(); RealMatrix getWeightSquareRoot(); @Deprecated double[][] getCovariances(); @Deprecated double[][] getCovariances(double threshold); double[][] computeCovariances(double[] params,
                                         double threshold); @Deprecated double[] guessParametersErrors(); double[] computeSigma(double[] params,
                                 double covarianceSingularityThreshold); @Override @Deprecated PointVectorValuePair optimize(int maxEval,
                                         final DifferentiableMultivariateVectorFunction f,
                                         final double[] target, final double[] weights,
                                         final double[] startPoint); @Deprecated PointVectorValuePair optimize(final int maxEval,
                                         final MultivariateDifferentiableVectorFunction f,
                                         final double[] target, final double[] weights,
                                         final double[] startPoint);  }
@Test public void testGetChiSquare() throws IOException { final StatisticalReferenceDataset dataset; dataset = StatisticalReferenceDatasetFactory.createKirby2(); final AbstractLeastSquaresOptimizer optimizer; optimizer = createOptimizer(); final double[] a = dataset.getParameters(); final double[] y = dataset.getData()[1]; final double[] w = new double[y.length]; Arrays.fill(w, 1.0); optimizer.optimize(1, dataset.getLeastSquaresProblem(), y, w, a); final double expected = dataset.getResidualSumOfSquares(); final double actual = optimizer.getChiSquare(); Assert.assertEquals(dataset.getName(), expected, actual, 1E-11 * expected); }