-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
The recursiveMeanVar function in utils.py would return zero if input l is interger. Suggest change the following code
muPlus = l / n * mu + m / n * np.mean(x)
if n > 1:
sigma2Plus = 1 / (n - 1) * ((l - 1) * sigma2 + (m - 1) * np.var(x) + l * (mu - muPlus) ** 2 + m * (np.mean(x) - muPlus) ** 2)
to
muPlus = mu * l / n + np.mean(x) * m / n
if n > 1:
sigma2Plus = ((l - 1.0)*sigma2 + (m - 1.0)*np.var(x) + l*(mu - muPlus)**2 + m*(np.mean(x) - muPlus)**2) / (n -1.0)
Metadata
Metadata
Assignees
Labels
No labels