我在matlab下想对函数 z=(a1)*x^2+(a2)*y^2+(a3)*x*y+(a4)*x+(a5)*y+a6 进行最小二乘 二次曲面拟合,数据为
x=[1.52 3.03 3.27 4.2 0.93 -4.2 -3.27 -3.03 -1.52];
y=[0.8 2.1 4.6 7.1 8.4 7.1 4.6 2.1 0.8];
z=[2.16 2.4 2.69 3.82 3.02 2.68 2.5 2.48 2.31];
查了不少资料,没有找到解决办法,还请各位多多帮忙。谢谢。
我是想实现二次曲面拟合,谢谢

 Réponse acceptée

befapej
befapej le 17 Nov 2022

0 votes

1stOpt计算很简单:
Function  z=a1*x^2+a2*y^2+a3*x*y+a4*x+a5*y+a6;
Data;
x=[1.52 3.03 3.27 4.2 0.93 -4.2 -3.27 -3.03 -1.52];
y=[0.8 2.1 4.6 7.1 8.4 7.1 4.6 2.1 0.8];
z=[2.16 2.4 2.69 3.82 3.02 2.68 2.5 2.48 2.31];
均方差(RMSE): 0.0427950134847893
残差平方和(SSE): 0.0164827186124697
相关系数(R): 0.995814169311262
相关系数之平方(R^2): 0.991645859801079
确定系数(DC): 0.99164585980108
卡方系数(Chi-Square): 0.00316149349967292
F统计(F-Statistic): 71.8206764207223
参数 最佳估算
---------- -------------
a1 0.04105577472433
a2 0.0228949530383977
a3 0.0301835132156013
a4 -0.0862349248786708
a5 -0.119329697275349
a6 2.21797501053882

Plus de réponses (0)

Catégories

En savoir plus sur 多项式 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!