Created
October 25, 2010 12:28
-
-
Save apatil/644869 to your computer and use it in GitHub Desktop.
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
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