title: Multivariate kernel density estimation in Python
body: <p>I am trying to use SciPy's <code>gaussian_kde</code> function to estimate the density of multivariate data. In my code below I sample a 3D multivariate normal and fit the kernel density but I'm not sure how to evaluate my fit.</p>
  
  <pre><code>import numpy as np
  from scipy import stats
  
  mu = np.array([1, 10, 20])
  sigma = np.matrix([[4, 10, 0], [10, 25, 0], [0, 0, 100]])
  data = np.random.multivariate_normal(mu, sigma, 1000)
  values = data.T
  kernel = stats.gaussian_kde(values)
  </code></pre>
  
  <p>I saw <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html" rel="noreferrer">this</a> but not sure how to extend it to 3D.</p>
  
  <p>Also not sure how do I even begin to evaluate the fitted density? How do I visualize this?</p>