Guest User

Untitled

a guest
Mar 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import numpy as np
  2. from scipy.stats import multivariate_normal
  3. mean = np.mean(z, axis=0)
  4. cov = np.cov(z, rowvar=0)
  5.  
  6. g = multivariate_normal(mean=mean, cov=cov)
  7.  
  8. # put a random sample of z through the pdf
  9. # to check the probability of the sample occurring
  10. print(g.pdf(z[np.random.randint(z.shape[0]),:]))
  11. >>> 0.0
Add Comment
Please, Sign In to add comment