AbstractLeastSquaresOptimizer extends BaseAbstractMultivariateVectorOptimizer<DifferentiableMultivariateVectorFunction> implements DifferentiableMultivariateVectorOptimizer { public double[] computeSigma(double[] params, double covarianceSingularityThreshold) { final int nC = params.length; final double[] sig = new double[nC]; final double[][] cov = computeCovariances(params, covarianceSingularityThreshold); for (int i = 0; i < nC; ++i) { sig[i] = FastMath.sqrt(cov[i][i]); } return sig; } @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 testComputeSigma() 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); final int dof = y.length - a.length; final PointVectorValuePair optimum = optimizer.optimize(1, dataset.getLeastSquaresProblem(), y, w, a); final double[] sig = optimizer.computeSigma(optimum.getPoint(), 1e-14); final double[] expected = dataset.getParametersStandardDeviations(); for (int i = 0; i < sig.length; i++) { final double actual = FastMath.sqrt(optimizer.getChiSquare() / dof) * sig[i]; Assert.assertEquals(dataset.getName() + ", parameter #" + i, expected[i], actual, 1e-7 * expected[i]); } }