Question

Does Matlab have an equivalent to nlminb in R?

I realize that lsqcurvefit is available in Matlab, but I specifically want a function that uses a derivative-based method, ideally exactly the same one as nlminb uses.

nlminb is described in this Stats.StackExhange.com answer.

I do not want to use the 'trust-region-refelective' method emplyed by lsqcurvefit for constrained problems.

Was it helpful?

Solution

Matlab's fmincon uses Quasi-Newton methods with constraints if the appropriate 'Algorithm' option is specified. Apparently R's nlminb is based on the L-BFGS-B code. Using the 'interior-point' algorithm this method of approximating the Hessian can be specified:

options = optimoptions('fmincon','Algorithm','interior-point','Hessian','lbfgs');

Unless you're running out of memory, the value of using 'lbfgs' over the default 'bfgs' is questionable. Try them all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top