24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1747  |  回复: 7
【悬赏金币】回答本帖问题,作者战神无极限将赠送您 10 个金币
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

战神无极限

铜虫 (小有名气)

[求助] 跪求1stOpt4.0以上版本,或者请高人帮忙拟合包含复数的函数的参数已有1人参与

程序代码我已写好,求帮忙拟合
Title   曲线拟合;
ComplexStr = i;
Parameter yibxilong_infite,yibxilong_s,tao,bet_a;
Variable Omega,y[realPart],y[imagPart];
Function y=yibxilong_infite+((yibxilong_s-yibxilong_infite)/((1+i*Omega*tao)^bet_a));
Data;
2        4.37523        0.62119
2.08        4.33845        0.62521
2.16        4.34997        0.63053
2.24        4.31506        0.65416
2.32        4.31287        0.64956
2.4        4.2921        0.6785
2.48        4.27592        0.67085
2.56        4.27271        0.68946
2.64        4.24622        0.69245
2.72        4.24252        0.69161
2.8        4.2235        0.70592
2.88        4.2131        0.69066
2.96        4.20274        0.7088
3.04        4.17474        0.69278
3.12        4.18037        0.69368
3.2        4.15111        0.68694
3.28        4.15204        0.67542
3.36        4.13015        0.68071
3.44        4.11932        0.65229
3.52        4.11557        0.66384
3.6        4.09273        0.64346
3.68        4.10344        0.64157
3.76        4.08152        0.63953
3.84        4.09644        0.63258
3.92        4.07714        0.64613
4        4.07915        0.62682
4.08        4.08866        0.64295
4.16        4.07995        0.64287
4.24        4.09006        0.65073
4.32        4.07778        0.66372
4.4        4.08659        0.65938
4.48        4.09006        0.69362
4.56        4.08228        0.68802
4.64        4.10068        0.71379
4.72        4.0723        0.72193
4.8        4.09413        0.73359
4.88        4.0731        0.75905
4.96        4.0816        0.74975
5.04        4.08084        0.78647
5.12        4.06507        0.77138
5.2        4.0818        0.79578
5.28        4.0533        0.79477
5.36        4.08002        0.7944
5.44        4.0605        0.81608
5.52        4.06823        0.79508
5.6        4.06843        0.82243
5.68        4.05722        0.79832
5.76        4.0792        0.81293
5.84        4.0543        0.81464
5.92        4.07444        0.80338
6        4.05518        0.8267
6.08        4.06451        0.80252
6.16        4.07049        0.84089
6.24        4.04613        0.8307
6.32        4.06599        0.84915
6.4        4.02474        0.86132
6.48        4.04207        0.85187
6.56        4.01568        0.8869
6.64        4.00774        0.861
6.72        4.01495        0.90078
6.8        3.98407        0.88764
6.88        4.01325        0.90488
6.96        3.97776        0.9195
7.04        4.00142        0.90944
7.12        3.99027        0.94878
7.2        3.99063        0.9286
7.28        4.01148        0.96782
7.36        3.98202        0.96614
7.44        4.02715        0.9764
7.52        3.99927        1.00541
7.6        4.0286        0.9848
7.68        4.02259        1.03537
7.76        4.0183        1.00616
7.84        4.04591        1.04756
7.92        4.00783        1.03853
8        4.04809        1.04458
8.08        4.00583        1.06889
8.16        4.02548        1.04709
8.24        4.00542        1.08586
8.32        3.97856        1.05657
8.4        3.99808        1.0767
8.48        3.94704        1.08118
8.56        3.97794        1.066
8.64        3.93227        1.11335
8.72        3.9337        1.07041
8.8        3.93626        1.13698
8.88        3.88795        1.09824
8.96        3.93594        1.15048
9.04        3.86228        1.15887
9.12        3.91482        1.16699
9.2        3.8589        1.22328
9.28        3.88337        1.18775
9.36        3.88369        1.2631
9.44        3.85848        1.23161
9.52        3.90621        1.2869
9.6        3.85492        1.29122
9.68        3.90851        1.28457
9.76        3.8738        1.3413
9.84        3.89225        1.29721
9.92        3.89533        1.37074
10        3.86391        1.32386
10.08        3.91378        1.35101
10.16        3.84783        1.35357
10.24        3.89741        1.33465
10.32        3.84317        1.3746
10.4        3.84082        1.31404
10.48        3.84381        1.36793
10.56        3.79267        1.32282
10.64        3.83601        1.34366
10.72        3.75153        1.35447
10.8        3.78495        1.32402
10.88        3.73595        1.37583
10.96        3.72531        1.32322
11.04        3.73699        1.39732
11.12        3.66998        1.37475
11.2        3.71147        1.40152
11.28        3.64639        1.43016
11.36        3.6951        1.40445
11.44        3.66645        1.49943
11.52        3.64921        1.45173
11.6        3.67278        1.53109
11.68        3.62043        1.50571
11.76        3.70031        1.54225
11.84        3.63168        1.57811
11.92        3.67956        1.54815
12        3.64643        1.61486
12.08        3.65567        1.54865
12.16        3.68399        1.61469
12.24        3.62965        1.58142
12.32        3.69052        1.59474
12.4        3.61013        1.60768
12.48        3.65312        1.56458
12.56        3.60661        1.61913
12.64        3.58948        1.55235
12.72        3.60285        1.6151
12.8        3.52316        1.58248
12.88        3.55328        1.60553
12.96        3.46259        1.6284
13.04        3.4799        1.59773
13.12        3.42929        1.67722
13.2        3.38338        1.63751
13.28        3.37557        1.70799
13.36        3.29446        1.68937
13.44        3.32208        1.7159
13.52        3.23213        1.76005
13.6        3.23184        1.72701
13.68        3.18662        1.79163
13.76        3.1535        1.73895
13.84        3.16797        1.78983
13.92        3.10565        1.77051
14        3.1318        1.75787
14.08        3.07723        1.77302
14.16        3.11093        1.70777
14.24        3.12093        1.74051
14.32        3.10783        1.68152
14.4        3.15819        1.68976
14.48        3.11168        1.66027
14.56        3.18533        1.61469
14.64        3.16197        1.64149
14.72        3.21006        1.57209
14.8        3.22436        1.6219
14.88        3.21211        1.55072
14.96        3.25935        1.57393
15.04        3.20934        1.55437
15.12        3.26857        1.52734
15.2        3.2262        1.55872
15.28        3.23214        1.51635
15.36        3.23624        1.56765
15.44        3.18766        1.52781
15.52        3.21679        1.5537
15.6        3.15515        1.5535
15.68        3.18251        1.53893
15.76        3.13452        1.58305
15.84        3.12766        1.55072
15.92        3.11925        1.6005
16        3.07438        1.58123
16.08        3.09502        1.59905
16.16        3.04198        1.61886
16.24        3.0635        1.62175
16.32        3.03214        1.68653
16.4        3.01135        1.66188
16.48        3.01369        1.71296
16.56        2.97412        1.71076
16.64        3.0108        1.75704
16.72        2.9509        1.79014
16.8        2.94444        1.79493
16.88        2.91727        1.84866
16.96        2.92702        1.82523
17.04        2.93201        1.88693
17.12        2.87968        1.89585
17.2        2.90914        1.91016
17.28        2.86698        1.89892
17.36        2.89035        1.86992
17.44        2.87119        1.90592
17.52        2.86254        1.87056
17.6        2.85872        1.88602
17.68        2.82335        1.8428
17.76        2.86058        1.8239
17.84        2.81505        1.82252
17.92        2.82796        1.7813
回复此楼
还请各位多多指教。
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

wlfc

新虫 (初入文坛)

拟合参数:yibxilong_infite,yibxilong_s,tao,bet_a  -- 当作复数,匹配度有所提高。
!!!using["luopt","math","win"]; //使用命名空间

y(yibxilong_infite,yibxilong_s,tao,bet_a,Omega)= yibxilong_infite+((yibxilong_s-yibxilong_infite)/((1+1i*Omega*tao)^bet_a));

目标函数(yibxilong_infite,y1,yibxilong_s,y2,tao,t,bet_a,b : i,s, e11,e22 : max, f, e1, e2)=
{
    i=-1, s=0, while{++i<max, toreal[y(yibxilong_infite$y1,yibxilong_s$y2,tao$t,bet_a$b,f(i,0)), &e11,&e22], s=s+[e1(i,0)-e11]^2+[e2(i,0)-e22]^2 },
    s
};

main(: tArray : max, f, e1, e2)=
{
    tArray=matrix{ //存放实验数据 //f    e1[realPart]    e2[imagPart]
        "2        4.37523        0.62119
2.08        4.33845        0.62521
。。。省略数据
17.92        2.82796        1.7813"
    },
    len[tArray,0,&max], f=tArray(all:0), e1=tArray(all:1),e2=tArray(all:2), //用len函数取矩阵的行数,f等取矩阵的列
    Opt1[@目标函数, optwaysimdeep, optwayconfra] //Opt1函数全局优化
};

结果:
3.657474298099148         1.626818043232671         4.318672722366502         0.3945758465293068        -8.820890726323174e-004   8.261459401821658e-002    -0.7118355007158153       2.904333614575917e-003    1.837635420785165

图形:https://blog.csdn.net/wlfc/article/details/119556598
8楼2021-08-10 08:20:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 8 个回答

dingd

铁杆木虫 (职业作家)

【答案】应助回帖

感谢参与,应助指数 +1
参考下:
Root of Mean Square Error (RMSE): 0.10112713083366
Sum of Squared Residual: 4.09067863625931
Correlation Coef. (R): 0.976111726914322
R-Square: 0.952794103419661
Adjusted R-Square: 0.952097809581063
Determination Coef. (DC): 0.942348917222362
F-Statistic: 1726.83608880207

Parameter                  Best Estimate
--------------------        -------------
yibxilong_infite        2.03236571080145
yibxilong_s        4.29651699920008
tao        -0.0130589159973196
bet_a        5.00743922766885

» 本帖已获得的红花(最新10朵)

2楼2020-11-07 09:53:39
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

战神无极限

铜虫 (小有名气)

送红花一朵
引用回帖:
2楼: Originally posted by dingd at 2020-11-07 09:53:39
参考下:
Root of Mean Square Error (RMSE): 0.10112713083366
Sum of Squared Residual: 4.09067863625931
Correlation Coef. (R): 0.976111726914322
R-Square: 0.952794103419661
Adjusted R-Square: 0.95 ...

能把拟合的图像也发一下吗?
还请各位多多指教。
3楼2020-11-07 18:04:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

战神无极限

铜虫 (小有名气)

引用回帖:
2楼: Originally posted by dingd at 2020-11-07 09:53:39
参考下:
Root of Mean Square Error (RMSE): 0.10112713083366
Sum of Squared Residual: 4.09067863625931
Correlation Coef. (R): 0.976111726914322
R-Square: 0.952794103419661
Adjusted R-Square: 0.95 ...

bet_a的范围是0到1之间,能在限制bet_a的范围的条件下拟合出来四个参数的最优值吗?
还请各位多多指教。
4楼2020-11-07 18:13:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
不应助 确定回帖应助 (注意:应助才可能被奖励,但不允许灌水,必须填写15个字符以上)
信息提示
请填处理意见