Created
September 3, 2013 21:20
-
-
Save ev-br/6429773 to your computer and use it in GitHub Desktop.
playing with scipy gh-2823 and https://github.com/EvgeniBurovski/scipy/tree/freeze_memoize
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 scipy.stats as stats | |
g = stats.gamma.pdf(8., 3.) | |
# no consequences for 'regular' distributions | |
print "\nregular @df=5:", stats.t.pdf(1., df=5) | |
print "\nregular @df=25:", stats.t.pdf(1., df=25) | |
print "\nregular @df=5:", stats.t.pdf(1., df=5) | |
#freeze | |
t5 = stats.t(df=5) | |
print "\nfrozen @df=5: ", t5.pdf(1.) | |
print "\nregular @df=25: ", stats.t.pdf(1., df=25) | |
# 2nd frozen instance | |
t35 = stats.t(df=35) | |
print "\nfrozen @df=5: ", t5.pdf(1.) | |
print "\nfrozen @df=35: ", t35.pdf(1.) | |
print "\nfrozen @df=5: ", t5.pdf(1.) | |
#other distributions are intact | |
print "previously, gamma was ", g | |
print "now it is still", stats.gamma.pdf(8., 3.) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment