How to plot the PDF of Gaussian mixture distribution with 2 components in 1 dimensions

2 views (last 30 days)
I have a vector of [1x1114] which is represented in the image bellow. I want to fit it to the Gaussian Mixture distribution.
I have followed the steps indicated in this link , and I get
gm =
Gaussian mixture distribution with 2 components in 1 dimensions
Component 1:
Mixing proportion: 0.500000
Mean: 3.3153
Component 2:
Mixing proportion: 0.500000
Mean: -61.5348
The values of Sigma are :
val(:,:,1) =
15.3648
val(:,:,2) =
137.2863
I want to plot the Gaussian mixture PDF but when I do the last step mentioned in the link which is
fsurf(@(x,y)reshape(pdf(gm,[x(:),y(:)]),size(x)),[-10 10])
I get this error
Warning: Error updating FunctionSurface.
The following error was reported evaluating the function in FunctionLine update: X must be a matrix with 1 columns.
Can somebody help me to plot the GM model to fit my data ? thank youu

Answers (0)

Community Treasure Hunt

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

Start Hunting!