normalization issue pdf gmm matlab

조회 수: 2 (최근 30일)
intesaaf ashraf
intesaaf ashraf 2022년 6월 3일
댓글: Torsten 2022년 6월 3일
I plotted a histogram normalized by pdf. I den fitted GMM model using fitgmdist. I then plotted the pdf of gmm over histrogram . I found pdf way too higher than the normalized histogram values. kindly help. I am attaching the data
options = statset('Display','final');
gmdist = fitgmdist(data',3,'CovType','diagonal','Regularize', 1e-5)
gmsigma = sqrt(gmdist.Sigma);
gmmu = gmdist.mu;
gmwt = gmdist.ComponentProportion;
histogram(data, 'Normalization', 'pdf', 'EdgeColor', 'none')
x = -5:0.0001:30;
xlim([-5 30])
hold on;
plot(x', pdf(gmdist, x'), 'k')
hold on;
  댓글 수: 2
Torsten
Torsten 2022년 6월 3일
I think the histogram is much too low ...
Torsten
Torsten 2022년 6월 3일
@intesaaf ashraf comment moved here:
ok but why histogram is so low then

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

채택된 답변

Tom Lane
Tom Lane 2022년 6월 3일
You have a substantial amount of missing (NaN) data. I believe the histogram function produces a density that integrates to the proportion of missing values. That is, part of the pdf is allocated to the NaN values so is not shown. Try this instead:
histogram(data(~isnan(data)), 'Normalization', 'pdf', 'EdgeColor', 'none')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by