}
return chiSqr;
}
};
final ScalarMinimizer lineMinimizer = new BrentMinimizer1D();
final ConjugateDirectionVectorMinimizer minimzer = new ConjugateDirectionVectorMinimizer(lineMinimizer, 1e-6, 10000);
final DoubleMatrix1D fp = transforms.transform(new DoubleMatrix1D(initialFitParameters));
final DoubleMatrix1D minPos = minimzer.minimize(function, fp);
final double chiSquare = function.evaluate(minPos);
final DoubleMatrix1D res = transforms.inverseTransform(minPos);
return new LeastSquareResultsWithTransform(new LeastSquareResults(chiSquare, res, new DoubleMatrix2D(new double[N_PARAMETERS][N_PARAMETERS])), transforms);
// return new LeastSquareResults(chiSquare, res, new DoubleMatrix2D(new double[N_PARAMETERS][N_PARAMETERS]));
}