Compare empirical CDF and lognormal CDF

조회 수: 2 (최근 30일)
Mos_bad
Mos_bad 2020년 4월 9일
답변: Jeff Miller 2020년 4월 9일
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
Mos_bad
Mos_bad 2020년 4월 9일
where do you mean? plot or logncdf? I almost tried both logarithmic and actual data values but didn't work. more specific please.
Ameer Hamza
Ameer Hamza 2020년 4월 9일
I was referring to the value of variable SD in your code. Did you generated it randomly, or do you have a dataset?

댓글을 달려면 로그인하십시오.

채택된 답변

Jeff Miller
Jeff Miller 2020년 4월 9일
logncdf wants the mean and sd of the logged scores. Try this:
fit_s=logncdf(sort(SD) , mean(log(SD)) , std(log(SD)) );

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by