Python Matlab lsqcurvefit() 函数的等价性
Python equivalence of Matlab lsqcurvefit() function
Matlab 函数 lsqcurvefit() 的等价或最接近 python 的函数是什么,例如 SciPy,它最小化了数据和参数化函数(曲线)之间的平方误差?
我知道 scipy.optimize.curve_fit 和 scipy.optimize.leastsq 很接近。但是,他们不使用信赖域相对最小二乘法。当然,我可以自己编写切换算法的条件。但是如果有现成的python代码,我就不用重新发明轮子了。
trf.py by Nikolay Mayorov implements a trust region reflective algorithm for least-squares optimization as does Matlab's lsqcurvefit() by default。
两者均基于 Thomas F. Coleman 和 Yuying Li 的作品:
"An Interior, Trust Region Approach for Nonlinear Minimization Subject to Bounds," SIAM 优化杂志,卷。 6,第 418–445 页,1996 年,PDF here
"On the Convergence of Reflective Newton Methods for Large-Scale Nonlinear Minimization Subject to Bounds," 数学规划,卷。 67,第 2 期,第 189–224 页,1994 年,PDF here.
Matlab 与 Mayorov 实现的实际算法可能存在一些差异,如后者的 blog 所示。
Matlab 函数 lsqcurvefit() 的等价或最接近 python 的函数是什么,例如 SciPy,它最小化了数据和参数化函数(曲线)之间的平方误差?
我知道 scipy.optimize.curve_fit 和 scipy.optimize.leastsq 很接近。但是,他们不使用信赖域相对最小二乘法。当然,我可以自己编写切换算法的条件。但是如果有现成的python代码,我就不用重新发明轮子了。
trf.py by Nikolay Mayorov implements a trust region reflective algorithm for least-squares optimization as does Matlab's lsqcurvefit() by default。
两者均基于 Thomas F. Coleman 和 Yuying Li 的作品:
"An Interior, Trust Region Approach for Nonlinear Minimization Subject to Bounds," SIAM 优化杂志,卷。 6,第 418–445 页,1996 年,PDF here
"On the Convergence of Reflective Newton Methods for Large-Scale Nonlinear Minimization Subject to Bounds," 数学规划,卷。 67,第 2 期,第 189–224 页,1994 年,PDF here.
Matlab 与 Mayorov 实现的实际算法可能存在一些差异,如后者的 blog 所示。