commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] Optimize non-differentiable multivariate real function with initial guess
Date Mon, 06 Aug 2012 21:43:46 GMT
Hello.

> 
> > 
> > i'm implementing in java a model which was originally developped in Matlab.
> > 
> > The goal is to minimize a non-differentiable trivariate real function.
> > The Matlab code calls the fminunc function
> > x = fminunc(fun,x0,options)
> > with x0 = [a, b, c] the initial guess, and
> > options as 'MaxFunEvals' to 500
> > 
> > I don't think the function is differentiable.
> > But i'm not very skilled in math
> > and mainly not at ease with the different parameters required for
> > optimizers creation...
> > 
> > Could someone advise me about which to use ?
> 
> Look at either NelderMeadSimplex, MultiDimensionalSimplex or
> CMAESOptimizer in the org.apache.commons.math3.optimization.direct package.

The easiest would be to start with "PowellOptimizer" (in the same package).

Code would be like:
---CUT---
    MultivariateOptimizer optim = new PowellOptimizer();
    MultivariateFunction f = ... your function ...

    PointValuePair result = optim.optimize(500, f, GoalType.MINIMIZE,
                                           new double[] { a, b, c});
    double[] minimum = result.getPoint();
---CUT---


Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message