How to plot the pdf of a 1D Gaussian Mixture Model with matplotlib

前端 未结 2 1452
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 17:01

I want to plot a Gaussian Mixture Model. The following code allows me to plot 2 separate Gaussians, but where they intersect, the line is very sharp and not smooth enough. Is th

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-24 17:35

    You have to form a convex combination of the densities.

    curve = p*curve_0 + (1-p)*curve_1
    

    where p is the probability that a sample comes from the first Gaussian.

提交回复
热议问题