【问题标题】:What is the closest approximation to R's nlminb in Matlab?Matlab 中 R 的 nlminb 最接近的近似值是多少?
【发布时间】:2013-11-21 19:12:30
【问题描述】:

Matlab 是否有与 R 中的 nlminb 等效的功能?

我意识到 lsqcurvefit 在 Matlab 中可用,但我特别想要一个使用基于导数的方法的函数,理想情况下与 nlminb 使用的方法完全相同。

nlminbthis Stats.StackExhange.com answer 中描述。

我不想使用lsqcurvefit 使用的'trust-region-refelective' 方法来解决受限问题。

【问题讨论】:

  • 您是否真的像链接的 Stats.StackExhange.com 问题/答案中那样执行最大似然估计?
  • 不,我正在执行最小二乘拟合,但我想针对基于导数的优化器测试新的优化器。

标签: r matlab optimization nonlinear-optimization


【解决方案1】:

如果指定了适当的'Algorithm' 选项,则Matlab 的fmincon 使用带有约束的Quasi-Newton methods。显然 R 的nlminb 是基于L-BFGS-B code。使用'interior-point'算法这种近似Hessian的方法can be specified

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

除非内存不足,否则使用 'lbfgs' 而非默认 'bfgs' 的价值值得怀疑。全部尝试。

【讨论】:

  • 是否将 lsqcurvefit 与 levenberg-marquardt 算法一起使用(即我放弃约束但确保初始猜测完全在所需的范围内)也能很好地近似 nlminb?还是 fmincon 更接近?
  • 不知道。 Levenberg-Marquardt 不是准牛顿方法。它是Gauss-Newton 和梯度下降的组合。它非常坚固。 lsqcurvefit 是为拟合数据而设计的,所以如果这是您的应用程序,请尝试一下。我不明白为什么你也可以使用默认的'trust-region-reflective',除非required conditions to use it is not met 之一,该函数会警告你。
  • 嘿,当我尝试使用 fminunc 运行它时,我得到:???在 223 使用 ==> optimset 时出错 OPTIONS 参数算法的值无效:必须是 'active-set'、'trust-region-reflective'、'interior-point'、'interior-point-convex'、'levenberg-marquardt' 、'trust-region-dogleg'、'lm-line-search' 或 'sqp'。错误 ==> Optimal_Lambda_fmin 在 64 个选项=optimset('Algorithm','quasi-newton','HessUpdate','bfgs','MaxFunEvals',10000,'TolFun',1e-16,'MaxIter',10000) ;虽然“准牛顿”显示为 2013b 版的可用算法,但我使用的是 2011a !!
  • 你知道上面哪一个算法和nlminb是一样的吗?
  • 在 R2011a 中,fminunchere are the actual choices for algorithm。尽管错误说明了什么,但您实际上不能为此求解器设置'Algorthm' 属性,除非问题是大型或中等规模的,这会改变事情。大规模方法需要您指定梯度。如果您使用中等规模方法,您可以为'HessUpdate' 属性指定'bfgs',它可能最接近nlminb
猜你喜欢
  • 2019-01-24
  • 1970-01-01
  • 1970-01-01
  • 2021-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-29
相关资源
最近更新 更多