Created
May 8, 2020 00:30
-
-
Save metab0t/08119857fd3cf4b39e01bb0a29d7d02b to your computer and use it in GitHub Desktop.
Generate multivariate normal distribution samples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import multivariate_normal as multinorm | |
import numpy as np | |
mean = np.zeros(3) | |
cov = np.eye(3) | |
dist = multinorm(mean=mean, cov=cov) | |
n_samples = 1000 | |
samples = dist.rvs(size=n_samples) | |
samples.shape | |
# = (1000, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment