Last active
June 28, 2019 09:39
Revisions
-
aliakbars revised this gist
Jun 28, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,6 @@ pm.traceplot(coin_trace); print('p(coin=fair|HH)={}'.format( coin_trace['which_coin'].mean() )) -
aliakbars revised this gist
Jun 18, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,6 @@ coin_trace = pm.sample(5000, tune=2500) pm.traceplot(coin_trace); print('p(coin=fair|HH)={}'.format(coin_trace['which_coin'].mean()) -
aliakbars created this gist
Jun 18, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ import pymc3 as pm with pm.Model() as coinflip: which_coin = pm.Bernoulli('which_coin', 0.5) theta_biased = pm.Uniform('theta_biased', 0, 1) p = pm.math.switch(which_coin > 0.5, 0.5, theta_biased) heads = pm.Binomial('heads', n=2, p=p, observed=2) coin_trace = pm.sample(5000, tune=2500) pm.traceplot(coin_trace);