可能重复:
概率分布值超过 1 可以吗?
当 x = mu 时计算 p(x | mu, sigma) 时,我如何得到大于 1 的概率我有点困惑。例如,如果我运行:
>> gaussProb(0, 0, 0.1)
ans =
1.2616
其中 gaussProb 是 PMTK 工具箱中的一个 matlab 函数:
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
这是高斯分布的一些基本属性还是计算中数值准确性的问题?
我通过尝试对从高斯过程预测获得的高斯分布中的样本进行加权来遇到这个问题,在那里我将获得巨大的概率。
谢谢