Generate Gaussian Mixture Distribution samples for PEM

How to generate samples from GMM distribution? I wanna set them to point estimation method.

 채택된 답변

Bruno Luong
Bruno Luong 2018년 10월 10일
% Characteristics of your GM distribution
mu = [1,2,5]
sigma = [0.2, 0.3, 0.4];
A = [5 3 2];
% number of samples
n = 10000;
c = [0, cumsum(A(:)')];
c = c/c(end);
[~,i] = histc(rand(1,n),c);
r = randn(1,n).*sigma(i) + mu(i);
hist(r,100)

댓글 수: 3

Bruno Luong
Bruno Luong 2018년 10월 10일
편집: Bruno Luong 2018년 10월 10일
Depending on your definition you might multiply A by sigma before feed it to the cumsum command.
c = [0, cumsum((A(:).*sigma(:))')];
Thank you Bruno Luong. But how can estimate 2 point?
Sorry I don't know point estimation method to answer.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Descriptive Statistics and Insights에 대해 자세히 알아보기

질문:

2018년 10월 10일

댓글:

2018년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by