Probability distribution value exceeding 1 is OK?
I'm a bit confused how I am getting probabilities greater than 1 when calculating p(x | mu, sigma) when x = mu. For example, if I run:
>> gaussProb(0, 0, 0.1) ans = 1.2616
where gaussProb is a matlab function from the PMTK toolbox:
function p = gaussProb(X, mu, Sigma) % Multivariate Gaussian distribution, pdf % X(i,:) is i'th case % *** In the univariate case, Sigma is the variance, not the standard % deviation! *** % This file is from pmtk3.googlecode.com d = size(Sigma, 2); X = reshape(X, , d); % make sure X is n-by-d and not d-by-n X = bsxfun(@minus, X, rowvec(mu)); logp = -0.5*sum((X/(Sigma)).*X, 2); logZ = (d/2)*log(2*pi) + 0.5*logdet(Sigma); logp = logp - logZ; p = exp(logp); end
Is this some fundamental property of the Gaussian distribution or an issue with numerical accuracy in the computation?
I've come across this issue by trying to weight samples from a Gaussian distribution obtained from a Gaussian process prediction, where I will get massive probabilities.