Fitting function to ecdf plot
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Exploration and Visualization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!