pdf_multivariate_gauss() function in Python
<p>Which are the necessary modules for execution of the function pdf_multivariate_gauss() in IPython? </p>

<p>I try to execute the below code but i get errors like "Import Error" and "Name Error".</p>

<p><strong><em>Code:</em></strong></p>

<pre><code>import numpy as np
from matplotlib import pyplot as plt
from matplotlib.mlab import bivariate_normal
import parzen_window_est
import pdf_multivariate_gauss   ######## ImportError ########
import operator


from mpl_toolkits.mplot3d import Axes3D

##############################################
### Predicted bivariate Gaussian densities ###
##############################################


mu_vec = np.array([0,0])
cov_mat = np.array([[1,0],[0,1]])
x_2Dgauss = np.random.multivariate_normal(mu_vec, cov_mat, 10000)
# generate a range of 400 window widths between 0 &lt; h &lt; 1
h_range = np.linspace(0.001, 1, 400)

# calculate the actual density at the center [0, 0]
mu = np.array([[0],[0]])
cov = np.eye(2)
actual_pdf_val = pdf_multivariate_gauss.pdf_multivariate_gauss(np.array([[0],[0]]), mu, cov) 
######## NameError #########

# get a list of the differnces (|estimate-actual|) for different window widths
parzen_estimates = [np.abs(parzen_window_est.parzen_window_est(x_2Dgauss, h=1, center=[0, 0])) for i in h_range]

# get the window width for which |estimate-actual| is closest to 0
min_index, min_value = min(enumerate(parzen_estimates), key=operator.itemgetter(1))
</code></pre>

<p><a href="http://i.stack.imgur.com/uqWUp.png" rel="nofollow">IPython output</a></p>

<p>As far as I can tell, there is no such thing as pdf_multivariate_gauss (as pointed out already). There is a python implementation of this in <code>scipy</code>, however: <a href="http://docs.scipy.org/doc/scipy-0.18.0/reference/generated/scipy.stats.multivariate_normal.html" rel="nofollow">scipy.stats.multivariate_normal</a></p>

<p>One would use it like this:</p>

<pre><code>from scipy.stats import multivariate_normal
mvn = multivariate_normal(mu,cov) #create a multivariate Gaussian object with specified mean and covariance matrix
p = mvn.pdf(x) #evaluate the probability density at x
</code></pre>

python numpy matplotlib scipy ipython