用lsqcurvef​it没能拟合出参数,​求各位指教。代码如下​。

조회 수: 3 (최근 30일)
periyo
periyo 2022년 11월 23일
답변: bipeh 2022년 11월 23일
function f=XU(x,data)
XOD=data(1,:);
UA=data(2,:);
f=x(1)*(1+(x(2)*XOD)./(XOD+x(3)))-x(4)*UA
clc;
XOD=[13.920855 16.137478 18.802967 21.793845 19.668576 22.731821 23.275489 28.416212 30.66387];
UA=[34.723876 114.1186 91.402479 79.854949 77.639966 92.321463 104.54 96.047456 106.25276];
ydata=[10.4299978000000,-1.45032320000000,-0.425708066666667,0.0532981666666667,-0.00421063333333341,0.138016733333333,-0.0427233666666666,-0.0627239250000000,-0.0827244833333334];
data=[XOD;UA];
option=optimset('MaxFunEvals',50000000);
x0=[0.5 0.5 0.1 1];
[a,resnorm]=lsqcurvefit(@XU,x0,data,ydata,[0 0 0 0],[],option);
出现在命令栏中的提示如下:
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.
<stopping criteria details>

채택된 답변

bipeh
bipeh 2022년 11월 23일
如果要求都大于0,加一句:ParameterDomain = [0,];
均方差(RMSE):1.50695589848579
残差平方和(SSE):20.43824471983
相关系数(R): 0.895278856473547
相关系数之平方(R^2): 0.801524230848583
确定系数(DC): 0.801524230848583
卡方系数(Chi-Square): 9.45032996543549
F统计(F-Statistic): 8.39733068571794
参数 最佳估算
---------- -------------
x1 1.89870321365435
x2 5.89251645596632
x3 3.8799368609697E-15
x4 0.137066729882979

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 线性最小二乘에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!