}
public void solveExactFromChiSqTest() {
final DoubleMatrix1D start = new DoubleMatrix1D(new double[] {1.2, 0.8, -0.2, -0.3 });
final Function1D<DoubleMatrix1D, Double> f = getChiSqFunction(X, Y, SIGMA, PARAM_FUNCTION);
final ConjugateGradientVectorMinimizer minimizer = new ConjugateGradientVectorMinimizer(new BrentMinimizer1D());
final DoubleMatrix1D solution = minimizer.minimize(f, start);
assertEquals(0.0, f.evaluate(solution), 1e-8);
assertEquals(1.0, solution.getEntry(0), 1e-8);
assertEquals(1.0, solution.getEntry(1), 1e-8);
assertEquals(0.0, solution.getEntry(2), 1e-8);