我试图用matlab中的levenberg-Marquardt最小二乘法在我的数据中拟合一个具有四个未知参数的巨大函数。我用这个命令:levenberg marquardt曲线拟合MATLAB有几个参数
[x, resnorm]=lsqcurvefit(@myfun1,[-100:100], xdata, ydata, ...
[-inf, -inf, -1.5, -inf], [inf, inf, 1.5, inf], options)
这意味着我有兴趣约束第三个参数。但我面对这个问题:
??? Error using ==> lsqncommon at 102
Levenberg-Marquardt and Gauss-Newton algorithms do not handle bound constraints and trust-region-reflective algorithm
requires at least as many equations as variables; aborting.
Error in ==> lsqcurvefit at 258
[xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
我觉得这个错误表明,因为他们是36点,或可能有太多的未知参数,我的数据是小,但我觉得对于拟合四个未知参数是好的!
那么,你觉得怎么样?这是否意味着MATLAB不能适应这个36点数据的功能?
我会很感激任何意见。
我认为这个错误信息是因为matlab被要求用一个只有36个数据点的201参数定义的曲线。换句话说,201只有36个LM不能做的方程式。将[-100:100]更改为[0 0 0 0],或者如果可以计算出一个更明智的起点,几乎肯定会解决此错误。 – Dan
@Dan是的,我同意。我已经更新了答案,将OP指向您的评论。 – mathematician1975