【求助】公式回归的问题
目前正在做一个公式的拟合,本来想用matlab的nlinfit函数,但无法确定初始值,改用1stopt后也不行,请大家看看要怎么办,数据如下:Parameters p1,p2,p3,p4,p5,p6;
Variable x1,x2,x3,x4,x5,y;
Function y=(p1/(x4+p2))*x1+p3*x2+p4*x3+(p5/(x4+p6))*x5;
data;//x1,x2,x3,x4,x5,y
24.60.63010.2321.03.7896.666
24.60.6304.093 1.03.7896.178
23.00.63015.6471.03.7896.666
23.00.63021.5151.03.7896.738
20.00.63023.2201.03.7896.494
20.01.26026.7921.03.7896.463
20.01.26026.7921.03.7896.641
20.01.26032.1511.03.7896.519
19.11.26013.8821.03.7896.519
19.10.00022.5581.03.7895.003
19.10.00013.8821.03.7895.225
22.51.32341.2511.03.7896.250
26.70.59416.9141.54.0375.897
23.00.59416.8811.54.0376.282
26.60.39516.8691.54.0376.154
29.80.39515.8461.54.0376.410
27.30.61516.4132.03.2775.405
26.10.61517.6792.03.2775.676
用1stopt1.5试用版给出的解答是
p1=0.04859 p2=-0.36819 p3=0.9808 p4=-0.013658 p5=-7.83245 p6=-8.13435
这个答案离我预想的差的很多,预想的是系数都在0-2之间波动,允许p2,p6为不大于1的负值,
请问大家还有什么好的办法没?谢谢
回复
Matlab可以用lsqcurvefit实现多元拟合,你可以试试. 如果没有范围限制,1stOpt几乎每次都可得最好结果:oot of Mean Square Error (RMSE): 0.276250222924944
Sum of Square Error (SSE): 1.37365534198946
Correlation Coef. (R): 0.841496864554441
R-Square: 0.708116973054954
Determination Coef. (DC): 0.708081345035083
Chi-Square: 0.222471519225999
F-Statistic: 8.22146840971309
Parameters Best Estimate
---------- -------------
p1 0.0522920018082004
p2 -0.423274352427706
p3 0.931516529479507
p4 -0.0115074648739728
p5 -4.60349262149789
p6 -5.52105479237094
====== Output Results =====
No Observed y Calculated y
1 6.666 6.55769468318984
2 6.178 6.62833901005116
3 6.666 6.35030896372705
4 6.738 6.28278315984658
5 6.494 5.99115143754229
6 6.463 6.53690218658455
7 6.641 6.53690218658455
8 6.519 6.47523368232492
9 6.519 6.60386010969928
10 5.003 5.33031051730852
11 5.225 5.4301492825551
12 6.25 6.65587753890745
13 5.897 6.27713685473589
14 6.282 6.09782328075267
15 6.154 6.08742632506382
16 6.41 6.25460890082909
17 5.405 5.57382417887176
18 5.676 5.51945780771608
“允许p2,p6为不大于1的负值”,这句话有点不懂,既然为负值,就应该小于0,怎么又不大于1? 用spss把 “允许p2,p6为不大于1的负值”,这句话有点不懂,既然为负值,就应该小于0,怎么又不大于1?
原来写错了,是允许p2和p6为负值,范围是-1-0。
请问现在有什么软件能限定求解范围的?
页:
[1]