当前位置: 首页 > 程序语言 >MATLAB非线性方程回归中系统提示错误

MATLAB非线性方程回归中系统提示错误

作者 琳姑娘
来源: 小木虫 150 3 举报帖子
+关注

本人刚接触MATLAB做非线性回归拟合,运行结果中 系统会提示:lsqnonlin stopped because the final change in the sum of squares relative to its initial value is less than the default value of the function tolerance.? ? (相对平方和的最终变化的初始值小于该函数公差的默认值。)
不知是哪里出现问题了,大神们可否指点一下,先谢谢大家了!

 返回小木虫查看更多

今日热帖
  • 精华评论
  • hzlhm

    这样的比较难回答?有具体的模型和数据吗?

  • 琳姑娘

    引用回帖:
    2楼: Originally posted by hzlhm at 2021-03-18 16:21:39
    这样的比较难回答?有具体的模型和数据吗?

    x=[0;0.0909100000000000;0.148940000000000;0.230770000000000;0.272730000000000;0.310340000000000;0.400000000000000;0.500000000000000;0.571430000000000;0.666670000000000;0.800000000000000;1];
    >> y=[0;0.399150000000000;0.558020000000000;0.597720000000000;0.637450000000000;0.697020000000000;0.776450000000000;0.849910000000000;0.883680000000000;0.925390000000000;0.935300000000000;0.984960000000000];
    >> fun=@(p,x)(((x./p(3))./(1-(x./p(3))))+((p(1).*(x.^p(1)).*p(2)))./(1+x1.^p(1).*p(2)));
    >> x0=[1,7,10];
    >> p=lsqcurvefit(fun,x0,x1,y)

    Local minimum possible.

    lsqcurvefit stopped because the final change in the sum of squares relative to
    its initial value is less than the default value of the function tolerance.

    以上是我运行中的数据,方程以及出现的问题,麻烦您给看看是哪里除了问题,谢谢

  • hzlhm

    没有出现你给出的警告。
    但程序有几个小错误,如
    fun=@(p,x)(((x./p(3))./(1-(x./p(3))))+((p(1).*(x.^p(1)).*p(2)))./(1+x1.^p(1).*p(2)));    %x1应该为x
    p=lsqcurvefit(fun,x0,x1,y)  %x1应该为x
    把x1改成x,运行后可以得到如下结果
    MATLAB非线性方程回归中系统提示错误
    123a.jpg

猜你喜欢
下载小木虫APP
与700万科研达人随时交流
  • 二维码
  • IOS
  • 安卓