Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from scipy.stats import multivariate_normal
- mean = np.mean(z, axis=0)
- cov = np.cov(z, rowvar=0)
- g = multivariate_normal(mean=mean, cov=cov)
- # put a random sample of z through the pdf
- # to check the probability of the sample occurring
- print(g.pdf(z[np.random.randint(z.shape[0]),:]))
- >>> 0.0
Add Comment
Please, Sign In to add comment