Generate Gaussian Mixture Distribution samples for PEM

 Respuesta aceptada

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

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Descriptive Statistics and Insights en Centro de ayuda y File Exchange.

Preguntada:

el 10 de Oct. de 2018

Comentada:

el 13 de Oct. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by