Generate Gaussian Mixture Distribution samples for PEM

Bahman · Apr 19, 2022 · 1.8K views
Question
How to generate samples from GMM distribution? I wanna set them to point estimation method.
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Aug 30, 2026
% 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)

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!