I need to generate random samples from a Wishart Distribution in Python. Is there a simple way to do that?
Asked
Active
Viewed 2,166 times
1 Answers
2
scipy has a package for wishart:
import numpy as np
from scipy.stats import wishart
x = np.linspace(1e-5, 8, 100) # make an array
for y in x:
z = wishart.rvs(1, scale=y)
print(z)
output:
4.59465858669e-06
0.00403122342709
0.0268879506122
0.0100029090879
0.129477863995
0.372787021348
....
wishart.rvs is the wishart function for random variate sampling.

d_kennetz
- 5,219
- 5
- 21
- 44
-
1Can just do wishart.rvs(df, scale_matrix) – Rumu Nov 16 '18 at 21:53