Skip to content

Commit 5016eab

Browse files
authored
Merge branch 'master' into travis-ghpages
2 parents 62df3d5 + e4ca1db commit 5016eab

14 files changed

+87
-73
lines changed

notebooks/02-Instructor-Parameter_estimation_hypothesis_testing.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"import matplotlib.pyplot as plt\n",
2121
"import pymc3 as pm\n",
2222
"from ipywidgets import interact\n",
23+
"import arviz as az\n",
2324
"%matplotlib inline\n",
2425
"sns.set()"
2526
]
@@ -374,7 +375,7 @@
374375
"with Model:\n",
375376
" samples = pm.sample(2000, njobs=1)\n",
376377
"\n",
377-
"pm.plot_posterior(samples);"
378+
"az.plot_posterior(samples, kind='hist');"
378379
]
379380
},
380381
{
@@ -458,7 +459,7 @@
458459
"with model:\n",
459460
" samples = pm.sample(2000, njobs=1)\n",
460461
" \n",
461-
"pm.plot_posterior(samples);"
462+
"az.plot_posterior(samples);"
462463
]
463464
},
464465
{
@@ -540,7 +541,7 @@
540541
"source": [
541542
"with Model:\n",
542543
" samples = pm.sample(2000, njobs=1)\n",
543-
"pm.plot_posterior(samples);"
544+
"az.plot_posterior(samples, kind='hist');"
544545
]
545546
},
546547
{
@@ -598,7 +599,7 @@
598599
"# bust it out & sample\n",
599600
"with model:\n",
600601
" samples = pm.sample(2000, njobs=1)\n",
601-
"pm.plot_posterior(samples, varnames=['μ_1', 'μ_2', 'diff_means', 'effect_size']);"
602+
"az.plot_posterior(samples, var_names=['μ_1', 'μ_2', 'diff_means', 'effect_size'], kind='hist');"
602603
]
603604
}
604605
],
@@ -618,7 +619,7 @@
618619
"name": "python",
619620
"nbconvert_exporter": "python",
620621
"pygments_lexer": "ipython3",
621-
"version": "3.6.6"
622+
"version": "3.6.8"
622623
}
623624
},
624625
"nbformat": 4,

notebooks/02-Student-Parameter_estimation_hypothesis_testing.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"import matplotlib.pyplot as plt\n",
2121
"import pymc3 as pm\n",
2222
"from ipywidgets import interact\n",
23+
"import arviz as az\n",
2324
"%matplotlib inline\n",
2425
"sns.set()"
2526
]
@@ -366,7 +367,7 @@
366367
" samples = ___\n",
367368
"\n",
368369
"# Plot posterior\n",
369-
"pm.plot_posterior(samples);"
370+
"az.plot_posterior(samples);"
370371
]
371372
},
372373
{
@@ -451,7 +452,7 @@
451452
" samples = ___\n",
452453
"\n",
453454
"# Plot posterior\n",
454-
"pm.plot_posterior(samples);"
455+
"az.plot_posterior(samples);"
455456
]
456457
},
457458
{
@@ -533,7 +534,7 @@
533534
"source": [
534535
"with Model:\n",
535536
" samples = pm.sample(2000, njobs=1)\n",
536-
"pm.plot_posterior(samples);"
537+
"az.plot_posterior(samples);"
537538
]
538539
},
539540
{
@@ -588,7 +589,7 @@
588589
"# bust it out & sample\n",
589590
"with model:\n",
590591
" samples = pm.sample(2000, njobs=1)\n",
591-
"pm.plot_posterior(samples, varnames=['μ_1', 'μ_2', 'diff_means', 'effect_size']);"
592+
"az.plot_posterior(samples, var_names=['μ_1', 'μ_2', 'diff_means', 'effect_size']);"
592593
]
593594
}
594595
],
@@ -608,7 +609,7 @@
608609
"name": "python",
609610
"nbconvert_exporter": "python",
610611
"pygments_lexer": "ipython3",
611-
"version": "3.6.6"
612+
"version": "3.6.8"
612613
}
613614
},
614615
"nbformat": 4,

notebooks/03-instructor-two-group-iq.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"import matplotlib.pyplot as plt\n",
1212
"import pymc3 as pm\n",
1313
"import seaborn as sns\n",
14+
"import arviz as az\n",
1415
"from utils import ECDF\n",
1516
"from data import load_kruschke\n",
1617
"\n",
@@ -290,7 +291,7 @@
290291
"outputs": [],
291292
"source": [
292293
"# Use `pm.plot_posterior()`\n",
293-
"pm.plot_posterior(trace, varnames=['mu_drug', 'mu_placebo'])"
294+
"az.plot_posterior(trace, var_names=['mu_drug', 'mu_placebo'])"
294295
]
295296
},
296297
{
@@ -377,7 +378,7 @@
377378
"metadata": {},
378379
"outputs": [],
379380
"source": [
380-
"pm.plot_posterior(trace=trace, varnames=['diff_means', 'effect_size'])"
381+
"az.plot_posterior(trace=trace, var_names=['diff_means', 'effect_size'])"
381382
]
382383
},
383384
{
@@ -488,7 +489,7 @@
488489
"metadata": {},
489490
"outputs": [],
490491
"source": [
491-
"traces = pm.traceplot(trace_alt)"
492+
"traces = az.traceplot(trace_alt)"
492493
]
493494
},
494495
{
@@ -497,7 +498,7 @@
497498
"metadata": {},
498499
"outputs": [],
499500
"source": [
500-
"pm.plot_posterior(trace_alt, varnames=['mu', 'effect_size'])"
501+
"az.plot_posterior(trace_alt, var_names=['mu', 'effect_size'])"
501502
]
502503
},
503504
{
@@ -521,9 +522,9 @@
521522
],
522523
"metadata": {
523524
"kernelspec": {
524-
"display_name": "bayesian-modelling-tutorial",
525+
"display_name": "Python 3",
525526
"language": "python",
526-
"name": "bayesian-modelling-tutorial"
527+
"name": "python3"
527528
},
528529
"language_info": {
529530
"codemirror_mode": {
@@ -535,7 +536,7 @@
535536
"name": "python",
536537
"nbconvert_exporter": "python",
537538
"pygments_lexer": "ipython3",
538-
"version": "3.6.6"
539+
"version": "3.6.8"
539540
},
540541
"toc": {
541542
"base_numbering": 1,

notebooks/03-student-two-group-iq.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"import matplotlib.pyplot as plt\n",
1212
"import pymc3 as pm\n",
1313
"import seaborn as sns\n",
14+
"import arviz as az\n",
1415
"from utils import ECDF\n",
1516
"from data import load_kruschke\n",
1617
"\n",
@@ -287,7 +288,7 @@
287288
"metadata": {},
288289
"outputs": [],
289290
"source": [
290-
"# Use `pm.plot_posterior()`\n",
291+
"# Use `az.plot_posterior()`\n",
291292
"pm.__________________"
292293
]
293294
},
@@ -376,7 +377,7 @@
376377
"metadata": {},
377378
"outputs": [],
378379
"source": [
379-
"# Use `pm.plot_posterior`, but pass in different varnames\n",
380+
"# Use `az.plot_posterior`, but pass in different varnames\n",
380381
"_______________________"
381382
]
382383
},
@@ -488,7 +489,7 @@
488489
"metadata": {},
489490
"outputs": [],
490491
"source": [
491-
"traces = pm.traceplot(trace_alt)"
492+
"traces = az.plot_trace(trace_alt)"
492493
]
493494
},
494495
{
@@ -497,7 +498,7 @@
497498
"metadata": {},
498499
"outputs": [],
499500
"source": [
500-
"pm.plot_posterior(trace_alt, varnames=['mu', 'effect_size'])"
501+
"az.plot_posterior(trace_alt, var_names=['mu', 'effect_size'])"
501502
]
502503
},
503504
{
@@ -521,9 +522,9 @@
521522
],
522523
"metadata": {
523524
"kernelspec": {
524-
"display_name": "bayesian-modelling-tutorial",
525+
"display_name": "Python 3",
525526
"language": "python",
526-
"name": "bayesian-modelling-tutorial"
527+
"name": "python3"
527528
},
528529
"language_info": {
529530
"codemirror_mode": {
@@ -535,7 +536,7 @@
535536
"name": "python",
536537
"nbconvert_exporter": "python",
537538
"pygments_lexer": "ipython3",
538-
"version": "3.6.6"
539+
"version": "3.6.8"
539540
},
540541
"toc": {
541542
"base_numbering": 1,

notebooks/04-instructor-multi-group-comparsion-sterilization.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"from sklearn.preprocessing import LabelEncoder\n",
1515
"import theano.tensor as tt\n",
1616
"from utils import ECDF\n",
17+
"import arviz as az\n",
1718
"\n",
1819
"%load_ext autoreload\n",
1920
"%autoreload 2\n",
@@ -224,7 +225,7 @@
224225
"outputs": [],
225226
"source": [
226227
"# Plot the trace plots.\n",
227-
"pm.traceplot(trace)"
228+
"az.plot_trace(trace)"
228229
]
229230
},
230231
{
@@ -240,8 +241,8 @@
240241
"metadata": {},
241242
"outputs": [],
242243
"source": [
243-
"# Use the `forestplot` or `plot_posterior` functions.\n",
244-
"pm.forestplot(trace, varnames=['perc_reduction'], ylabels=sorted(mapping))"
244+
"# Use the `plot_forest` or `plot_posterior` functions.\n",
245+
"az.plot_forest(trace, var_names=['perc_reduction'], ylabels=sorted(mapping))"
245246
]
246247
},
247248
{
@@ -274,9 +275,9 @@
274275
],
275276
"metadata": {
276277
"kernelspec": {
277-
"display_name": "bayesian-modelling-tutorial",
278+
"display_name": "Python 3",
278279
"language": "python",
279-
"name": "bayesian-modelling-tutorial"
280+
"name": "python3"
280281
},
281282
"language_info": {
282283
"codemirror_mode": {
@@ -288,7 +289,7 @@
288289
"name": "python",
289290
"nbconvert_exporter": "python",
290291
"pygments_lexer": "ipython3",
291-
"version": "3.6.6"
292+
"version": "3.6.8"
292293
}
293294
},
294295
"nbformat": 4,

notebooks/04-student-multi-group-comparsion-sterilization.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"from sklearn.preprocessing import LabelEncoder\n",
1515
"import theano.tensor as tt\n",
1616
"from utils import ECDF\n",
17+
"import arviz as az\n",
1718
"\n",
1819
"%load_ext autoreload\n",
1920
"%autoreload 2\n",
@@ -239,7 +240,7 @@
239240
"outputs": [],
240241
"source": [
241242
"# Use the `forestplot` or `plot_posterior` functions.\n",
242-
"pm._______(_______, varnames=______)"
243+
"az._______(_______, var_names=______)"
243244
]
244245
},
245246
{
@@ -272,9 +273,9 @@
272273
],
273274
"metadata": {
274275
"kernelspec": {
275-
"display_name": "bayesian-modelling-tutorial",
276+
"display_name": "Python 3",
276277
"language": "python",
277-
"name": "bayesian-modelling-tutorial"
278+
"name": "python3"
278279
},
279280
"language_info": {
280281
"codemirror_mode": {
@@ -286,7 +287,7 @@
286287
"name": "python",
287288
"nbconvert_exporter": "python",
288289
"pygments_lexer": "ipython3",
289-
"version": "3.6.6"
290+
"version": "3.6.8"
290291
}
291292
},
292293
"nbformat": 4,

notebooks/05-instructor-two-group-comparison-finches.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"import seaborn as sns\n",
1414
"import numpy as np\n",
1515
"from utils import ECDF\n",
16+
"import arviz as az\n",
1617
"\n",
1718
"%load_ext autoreload\n",
1819
"%autoreload 2\n",
@@ -161,7 +162,7 @@
161162
"metadata": {},
162163
"outputs": [],
163164
"source": [
164-
"traces = pm.traceplot(trace)"
165+
"traces = az.plot_trace(trace)"
165166
]
166167
},
167168
{
@@ -177,7 +178,7 @@
177178
"metadata": {},
178179
"outputs": [],
179180
"source": [
180-
"pm.forestplot(trace, varnames=['mean'])"
181+
"az.plot_forest(trace, var_names=['mean'])"
181182
]
182183
},
183184
{
@@ -294,9 +295,9 @@
294295
],
295296
"metadata": {
296297
"kernelspec": {
297-
"display_name": "bayesian-modelling-tutorial",
298+
"display_name": "Python 3",
298299
"language": "python",
299-
"name": "bayesian-modelling-tutorial"
300+
"name": "python3"
300301
},
301302
"language_info": {
302303
"codemirror_mode": {
@@ -308,7 +309,7 @@
308309
"name": "python",
309310
"nbconvert_exporter": "python",
310311
"pygments_lexer": "ipython3",
311-
"version": "3.6.6"
312+
"version": "3.6.8"
312313
}
313314
},
314315
"nbformat": 4,

notebooks/05-student-two-group-comparison-finches.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"import seaborn as sns\n",
1414
"import numpy as np\n",
1515
"from utils import ECDF\n",
16+
"import arviz as az\n",
1617
"\n",
1718
"%load_ext autoreload\n",
1819
"%autoreload 2\n",
@@ -278,9 +279,9 @@
278279
],
279280
"metadata": {
280281
"kernelspec": {
281-
"display_name": "bayesian-modelling-tutorial",
282+
"display_name": "Python 3",
282283
"language": "python",
283-
"name": "bayesian-modelling-tutorial"
284+
"name": "python3"
284285
},
285286
"language_info": {
286287
"codemirror_mode": {
@@ -292,7 +293,7 @@
292293
"name": "python",
293294
"nbconvert_exporter": "python",
294295
"pygments_lexer": "ipython3",
295-
"version": "3.6.6"
296+
"version": "3.6.8"
296297
}
297298
},
298299
"nbformat": 4,

0 commit comments

Comments
 (0)