Fitting function to ecdf plot
Ältere Kommentare anzeigen
Hi
I am looking for a way to fit function g to the ecdf-plot I produce as follows.
T = 1000;
cens = (y>T);
ecdf(y,'Function','survivor', ...
'Censoring',cens,'Bounds','on');
g=fittype('a-b*exp(-c*x)');
I would like to use the bounds determined in ecdf as a weighting factor "w" for the fit.
I tried
h=gcf;
dataObjs = findobj(gcf,'-property','YData');
dmy3=dataObjs.XData;
x=dmy3';
dmy4=dataObjs.YData;
y2=dmy4';
g=fittype('a-b*exp(-c*x)');
f=fit(x,y2,g,'StartPoint',[[ones(size(x)), -exp(-x)]\y2; 1]);
hold on;
Though this is giving me the upper bounds as xData and yData.
Thanks in advance for any suggestion.
Peter
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Exploration and Visualization 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!