Generate Gaussian Mixture Distribution samples for PEM

Illustration
Bahman - 2022-04-19T09:28:34+00:00
Question: Generate Gaussian Mixture Distribution samples for PEM

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

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

% 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)

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!