Ältere Kommentare anzeigen
我在文件中写了个函数:function F = myfun(z,xdata)F = exp(z(1))./(exp(z(1))+exp(-z(1))).*exp(-(xdata./exp(z(3))).^exp(z(2)))+(1-exp(z(1))./(exp(z(1))+exp(-z(1)))).*exp(-(xdata./exp(z(5))).^exp(z(4)));
%%其实就是混合威布尔做了个变换,
z(0)=[1.7380;0.9555;-1.3863;2.0149;-2.5257];
[z,resnorm] = lsqcurvefit(@ercheng,z0,xdata,ydata1);
其中xdata=0.0580000000000000
0.0710000000000000
0.0760000000000000
0.0790000000000000
0.0830000000000000
0.0870000000000000
0.0980000000000000
0.111000000000000
0.117000000000000
0.122000000000000
0.122000000000000
0.133000000000000
0.134000000000000
0.138000000000000
0.140000000000000
0.142000000000000
0.150000000000000
0.155000000000000
0.160000000000000
0.160000000000000
0.168000000000000
0.173000000000000
0.173000000000000
0.173000000000000
0.175000000000000
0.176000000000000
0.177000000000000
0.181000000000000
0.182000000000000
0.183000000000000
0.194000000000000
0.203000000000000
0.214000000000000
0.218000000000000
0.222100000000000
0.223000000000000
0.225000000000000
0.247000000000000
0.253000000000000
0.256000000000000
0.257000000000000
0.258000000000000
0.262000000000000
0.263000000000000
0.264000000000000
0.266000000000000
0.267000000000000
0.276000000000000
0.278000000000000
0.280000000000000
0.288000000000000
0.289000000000000
0.306000000000000
0.315000000000000
0.333000000000000
0.335000000000000
0.353000000000000
0.389000000000000
0.404000000000000
0.418000000000000
0.456000000000000
0.489000000000000;
ydata1=0.983870967741936
0.967741935483871
0.951612903225807
0.935483870967742
0.919354838709677
0.903225806451613
0.887096774193548
0.870967741935484
0.854838709677419
0.838709677419355
0.822580645161290
0.806451612903226
0.790322580645161
0.774193548387097
0.758064516129032
0.741935483870968
0.725806451612903
0.709677419354839
0.693548387096774
0.677419354838710
0.661290322580645
0.645161290322581
0.629032258064516
0.612903225806452
0.596774193548387
0.580645161290322
0.564516129032258
0.548387096774193
0.532258064516129
0.516129032258064
0.500000000000000
0.483870967741935
0.467741935483871
0.451612903225806
0.435483870967742
0.419354838709677
0.403225806451613
0.387096774193548
0.370967741935484
0.354838709677419
0.338709677419355
0.322580645161290
0.306451612903226
0.290322580645161
0.274193548387097
0.258064516129032
0.241935483870968
0.225806451612903
0.209677419354839
0.193548387096774
0.177419354838710
0.161290322580645
0.145161290322581
0.129032258064516
0.112903225806452
0.0967741935483870
0.0806451612903230
0.0645161290322580
0.0483870967741930
0.0322580645161290
0.0161290322580639
0;
然后迭代停止了,原因如下:
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>
Optimization stopped because the relative sum of squares (r) is changing
by less than options.TolFun = 1.000000e-06.
Optimization Metric Options
relative change r = 8.13e-07 TolFun = 1e-06 (default)
我看了应该是每次迭代值得变化量太小了
请教怎么修改?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu 非线性优化 finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!