Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

theoric vs empiric PDF & CDF

조회 수: 3(최근 30일)
jean claude
jean claude 2017년 12월 5일
마감: MATLAB Answer Bot 2021년 8월 20일
hello guys, i want to know if there is a better way to compare the empiric PDF to the theoric PDF of a normal distribution sample (i know that histfit is a good way but my goal is to have two curves in the same plot), same thing for CDF. So i have a time series data x (1 column vector) and i want to see how it matchs with the normal distribution
%%PDF
xval = min(x):.01:max(x);
[muhat,sigmahat] = normfit(x);
yval = normpdf(xval,muhat,sigmahat);
plot(xval,yval) %theoric PDF
hold on
ksdensity(x) %empirical PDF
%%CDF
xval = min(x):.01:max(x);
f = evcdf(xval,muhat,sigmahat);
plot(xval,f,'m') %theoric CDF
hold on
cdfplot(x) %empirical CDF

답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by