Chapter02: LogGauss error
tndoan opened this issue · 1 comments
tndoan commented
There are some errors in logGauss.m
X = [1 2 4.0]; mu = 1; sigma=2
logGauss(X, mu, sigma)
The result is
-1.2655 -1.5155 -3.5155
while using the build-in function normpdf
provides a different result
normpdf(X, mu, sigma)
ans =
0.1760 0.1995 0.1210
sth4nth commented
logGauss requires variance, where normpdf requies standard deviation. Therefore you should compare
exp(logGauss(X,mu,sigma^2)) with normpdf(X,mu,sigma)