title: Multivariate Gaussian Distribution Scipy
body: <p>I have a two dimensional data, and I fit that data to Gaussian distribution as follows :-</p>
  
  <pre><code>from scipy.stats import multivariate_normal
  
  dataset = np.array([
      [3, 3],
      [3, 2],
      [4, 1],
      [4, 2],
      [4, 3],
      [4, 4],
      [5, 2],
      [5, 3]
  ])
  
  mu = np.mean(dataset, axis=0)
  
  sigma = np.cov(dataset.T)
  
  p = multivariate_normal(mean=mu, cov=sigma)
  
  print("pdf for [10, 10] : ", p.pdf(np.array([10, 10])))
  
  print("pdf for [5, 1] : ", p.pdf(np.array([5, 1])))
  </code></pre>
  
  <p>My question :-</p>
  
  <p>How do I accurately predict which dataset will belong to this distribution, should I used the Z score as a meausre, or is there some other way to do the same. Currently I am using zscore val as follows :-</p>
  
  <pre><code>from scipy.stats import zscore
  
  def getZScore(org_vals, new_val):
      org_vals.append(new_val)
      scores = zscore(org_vals)
      return scores[-1]
  
  pdfValsForTrainData = [p.pdf(item) for item in dataset]
  
  pdfVal = p.pdf(np.array([10, 10]))
  
  zScoreVal = getZScore(pdfValsForTrainData, pdfVal)
  
  print("z score for [10, 10] : ", zScoreVal)
  </code></pre>
  
  <p>The greater the deviation the more likelihood it does not belong to this distribution</p>
  
  <p>Is there any way to identify the epsilon value for distribution without any manual intervention ?</p>