Skip to content

Commit 078a513

Browse files
authored
Merge pull request #39 from canyon289/06_ins
Add ArviZ to 06-instructor
2 parents 267bd36 + 584717a commit 078a513

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

notebooks/06-instructor-hierarchical-baseball.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"import theano.tensor as tt\n",
1414
"from data import load_baseball\n",
1515
"from utils import despine, ECDF, despine_traceplot\n",
16+
"import arviz as az\n",
1617
"\n",
1718
"# For deterministic reproducibility.\n",
1819
"np.random.seed(42)\n",
@@ -160,7 +161,7 @@
160161
"metadata": {},
161162
"outputs": [],
162163
"source": [
163-
"traceplot = pm.traceplot(baseline_trace)\n",
164+
"traceplot = az.plot_trace(baseline_trace)\n",
164165
"despine_traceplot(traceplot)"
165166
]
166167
},
@@ -178,7 +179,7 @@
178179
"outputs": [],
179180
"source": [
180181
"ylabels = ylabels = \"AB: \" + df['AB'].astype(str) + ', H: ' + df['H'].astype('str')\n",
181-
"pm.forestplot(baseline_trace, ylabels=ylabels, xlim=[0, 1])"
182+
"az.plot_forest(baseline_trace, ylabels=ylabels, xlim=[0, 1])"
182183
]
183184
},
184185
{
@@ -272,7 +273,7 @@
272273
"metadata": {},
273274
"outputs": [],
274275
"source": [
275-
"ax_arr = pm.traceplot(trace)\n",
276+
"ax_arr = az.plot_trace(trace)\n",
276277
"despine_traceplot(ax_arr)"
277278
]
278279
},
@@ -290,7 +291,7 @@
290291
"outputs": [],
291292
"source": [
292293
"ylabels = \"AB: \" + df['AB'].astype(str) + ', H: ' + df['H'].astype('str')\n",
293-
"pm.forestplot(trace, varnames=['thetas'], ylabels=ylabels, xlim=[0, 1])"
294+
"az.plot_trace(trace, var_names=['thetas'], ylabels=ylabels, xlim=[0, 1])"
294295
]
295296
},
296297
{
@@ -376,9 +377,9 @@
376377
],
377378
"metadata": {
378379
"kernelspec": {
379-
"display_name": "bayesian-modelling-tutorial",
380+
"display_name": "Python 3",
380381
"language": "python",
381-
"name": "bayesian-modelling-tutorial"
382+
"name": "python3"
382383
},
383384
"language_info": {
384385
"codemirror_mode": {
@@ -390,7 +391,7 @@
390391
"name": "python",
391392
"nbconvert_exporter": "python",
392393
"pygments_lexer": "ipython3",
393-
"version": "3.6.6"
394+
"version": "3.6.8"
394395
}
395396
},
396397
"nbformat": 4,

0 commit comments

Comments
 (0)