Compare empirical CDF and lognormal CDF
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mos_bad
el 9 de Abr. de 2020
Respondida: Jeff Miller
el 9 de Abr. de 2020
I have a set of data that follows lognormal distribution. I'm trying to compare lognormal and empirical complementary CDF. However, the lognormal CCDF looks like a horizontal line (please see the attached).
here is the code:
[f_sc ,x_sc]=ecdf(SD); % empirical CDF
fit_s=logncdf(sort(SD) , mean(SD) , std(SD) ); % Lognormal CDF
plot(x_sc,1-f_sc,'-k','LineWidth',3); hold on;
plot( sort(SD) , 1-fit_s , '-r' , 'LineWidth', 3 ); hold on;
legend('Empirical CCDF','Lognormal CCDF','FontSize',14,'fontweight','bold','FontName','Time New Roman');
3 comentarios
Ameer Hamza
el 9 de Abr. de 2020
I was referring to the value of variable SD in your code. Did you generated it randomly, or do you have a dataset?
Respuesta aceptada
Jeff Miller
el 9 de Abr. de 2020
logncdf wants the mean and sd of the logged scores. Try this:
fit_s=logncdf(sort(SD) , mean(log(SD)) , std(log(SD)) );
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!