Validate.notNull(function, "function");
Validate.notNull(startPosition, "start position");
final MultivariateRealOptimizer optimizer = new NelderMead();
final MultivariateRealFunction commonsFunction = CommonsMathWrapper.wrapMultivariate(function);
try {
return new DoubleMatrix1D(CommonsMathWrapper.unwrap(optimizer.optimize(commonsFunction, MINIMIZER, startPosition.getData())));
} catch (final ConvergenceException e) {
throw new MathException(e);
} catch (final FunctionEvaluationException e) {
throw new MathException(e);
}