문제

I've used the gmdistribution to fit data to a Gaussian mixture model. I wanted to plot a contour plot http://imgur.com/yVE1M where the contours are obviously missing. For a 1D problem I found fplot, but now I'm stumped.

enter image description here

도움이 되었습니까?

해결책

I ran into a similar problem when I wrote an EM algorithm for gaussian mixtures. Here is the snippet of code that fixed it in my case:

for l=1:k
        zz=gmdistribution(MU(l,:),SIG(:,:,l),PI(l));
        ezcontour(@(x,y)pdf(zz,[x y]),[minx1 maxx1],[miny1 maxy1],250);
end

The key is to increase N:

ezcontour(...,N) plots FUN over the default domain using an N-by-N
grid. The default value for N is 60.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top