문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top