Skip to content

Commit 1137c91

Browse files
authored
Update EM.py
fix an error of formula
1 parent 09237f4 commit 1137c91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EM/EM.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def calcGauss(dataSetArr, mu, sigmod):
7373
:return: 整个可观测数据集的高斯分布密度(向量形式)
7474
'''
7575
#计算过程就是依据式9.25写的,没有别的花样
76-
result = (1 / (math.sqrt(2 * math.pi) * sigmod**2)) * \
76+
result = (1 / (math.sqrt(2 * math.pi) * sigmod)) * \
7777
np.exp(-1 * (dataSetArr - mu) * (dataSetArr - mu) / (2 * sigmod**2))
7878
#返回结果
7979
return result

0 commit comments

Comments
 (0)