Skip to content

Instantly share code, notes, and snippets.

@apatil
Created October 25, 2010 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apatil/644869 to your computer and use it in GitHub Desktop.
Save apatil/644869 to your computer and use it in GitHub Desktop.
import numpy as np
import pylab as pl
import pymc as pm
Tau_test = np.matrix([[ 209.47883244, 10.88057915, 13.80581557],
[ 10.88057915, 213.58694978, 11.18453854],
[ 13.80581557, 11.18453854, 209.89396417]])
C_test = Tau_test.I
ntest = 10000
w1 = np.array([pm.rwishart(10,Tau_test) for i in xrange(ntest)])
w2 = np.array([pm.rwishart_cov(10,C_test) for i in xrange(ntest)])
for name,arr in [('rwishart',w1),('rwishart_cov',w2)]:
pl.figure(figsize=(12,12))
pl.title(name)
for i in xrange(3):
for j in xrange(3):
pl.subplot(3,3,j*3+i+1)
pl.hist(arr[:,i,j])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment