为什么用fittype函数自定义正态分布密度函数去进行拟合,估计出来的参数和用normfit估计出来的参数,相差特别多呢?。
Ältere Kommentare anzeigen
如题,为什么用fittype函数自定义正态分布密度函数去进行拟合,所估计出来的参数和用normfit估计出来的参数,相差特别多呢?
代码如下,第一个
data=textread('E:\残差值\news.txt');
[m,n]=size(data);
x=reshape(data,m*n,1);
[yi,xi]=ksdensity(x);
normm=fittype(@(c,d,x) 0.39894228.*exp(-0.5.*(x-c).^2/d.^2)/d);
normmfit=fit(xi',yi',normm);
c=normmfit.c;
d=normmfit.d;
第二个
data=textread('E:\残差值\news.txt');
[m,n]=size(data);
x=reshape(data,m*n,1);
[a,b]=normfit(x);
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Linear and Nonlinear Regression 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!