Skip to content

Instantly share code, notes, and snippets.

@metab0t
Created May 8, 2020 00:30
Show Gist options
  • Save metab0t/08119857fd3cf4b39e01bb0a29d7d02b to your computer and use it in GitHub Desktop.
Save metab0t/08119857fd3cf4b39e01bb0a29d7d02b to your computer and use it in GitHub Desktop.
Generate multivariate normal distribution samples
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