def normal_density_at_zero(m, c):
""" Compute the normal density with given mean and covariance at zero.
Parameters
----------
m : vector
Mean.
c : ndarray
Covariance matrix. Assumption: c is square matrix and its size is
compatible with that of m.
Returns
-------
g : float
Computed density value.
"""
dim = len(m)
g = 1 / ((2 * pi)**(dim / 2) * sqrt(absolute(det(c)))) *\
exp(-1/2 * dot(dot(m, inv(c)), m))
return g
评论列表
文章目录