optimizer.setCostRelativeTolerance( CONVERGENCE );
optimizer.setParRelativeTolerance( CONVERGENCE );
optimizer.setOrthoTolerance( CONVERGENCE );
// BamFunction optimization
VectorialPointValuePair optimum = optimizer.optimize(function, target, weight, FIRST_GUESS);
// Covariances and errors
double[] fitErrors = optimizer.guessParametersErrors();
double[][] fitCovariance = optimizer.getCovariances();