Skip to content

Commit 1ba7529

Browse files
Replacing PyMC3 plots w/ Arviz plots & sigma Param change [Part 5] (#23)
* 🎨 Update plots from pymc to arviz dependencies & replace param sd with sigma * ⏪ Revert metadata changes in notebooks * 🐛 Set core=1 on pm.sample and update submodule reference * 🎨 Add version for Pymc3 and remove warnings import
1 parent 48af2ff commit 1ba7529

File tree

3 files changed

+504
-188
lines changed

3 files changed

+504
-188
lines changed

Diff for: examples/mixture_models/gaussian_mixture_model.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"name": "stdout",
1919
"output_type": "stream",
2020
"text": [
21-
"Fri 12 Jun 2020 07:12:54 PM UTC\r\n",
21+
"Fri 12 Jun 2020 07:12:54 PM UTC\n",
2222
"Running on PyMC3 v3.9.0\n"
2323
]
2424
}
@@ -218,7 +218,7 @@
218218
}
219219
],
220220
"source": [
221-
"pm.traceplot(tr, var_names=[\"p\", \"sd\", \"means\"]);"
221+
"az.plot_trace(tr, var_names=[\"p\", \"sd\", \"means\"]);"
222222
]
223223
},
224224
{
@@ -259,7 +259,7 @@
259259
],
260260
"source": [
261261
"# take a look at traceplot for some model parameters\n",
262-
"pm.plots.traceplot(tr[::5], var_names=[\"p\", \"sd\", \"means\"]);"
262+
"az.plot_trace(tr[::5], var_names=[\"p\", \"sd\", \"means\"]);"
263263
]
264264
},
265265
{
@@ -293,7 +293,7 @@
293293
],
294294
"source": [
295295
"# I prefer autocorrelation plots for serious confirmation of MCMC convergence\n",
296-
"pm.autocorrplot(tr[::5], var_names=[\"sd\"]);"
296+
"az.plot_autocorr(tr[::5], var_names=[\"sd\"]);"
297297
]
298298
},
299299
{
@@ -434,7 +434,7 @@
434434
"name": "python",
435435
"nbconvert_exporter": "python",
436436
"pygments_lexer": "ipython3",
437-
"version": "3.7.7"
437+
"version": "3.8.5"
438438
},
439439
"latex_envs": {
440440
"bibliofile": "biblio.bib",

Diff for: examples/ode_models/ODE_API_shapes_and_benchmarking.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"source": [
3030
"import logging\n",
3131
"\n",
32+
"import arviz\n",
3233
"import matplotlib.pyplot as plt\n",
3334
"import numpy as np\n",
3435
"import pymc3 as pm\n",
@@ -40,7 +41,6 @@
4041
"# this notebook show DEBUG log messages\n",
4142
"logging.getLogger(\"pymc3\").setLevel(logging.DEBUG)\n",
4243
"\n",
43-
"import arviz\n",
4444
"import IPython.display"
4545
]
4646
},
@@ -144,7 +144,7 @@
144144
" sigma = pm.HalfCauchy(\"sigma\", 1)\n",
145145
" vmax = pm.Lognormal(\"vmax\", 0, 1)\n",
146146
" K_S = pm.Lognormal(\"K_S\", 0, 1)\n",
147-
" s0 = pm.Normal(\"red_0\", mu=10, sd=2)\n",
147+
" s0 = pm.Normal(\"red_0\", mu=10, sigma=2)\n",
148148
"\n",
149149
" y_hat = pm.ode.DifferentialEquation(\n",
150150
" func=Chem.reaction, times=times, n_states=len(y0_true), n_theta=len(theta_true)\n",
@@ -153,8 +153,8 @@
153153
" red_hat = y_hat.T[0][red]\n",
154154
" blue_hat = y_hat.T[1][blue]\n",
155155
"\n",
156-
" Y_red = pm.Normal(\"Y_red\", mu=red_hat, sd=sigma, observed=y_obs_1)\n",
157-
" Y_blue = pm.Normal(\"Y_blue\", mu=blue_hat, sd=sigma, observed=y_obs_2)\n",
156+
" Y_red = pm.Normal(\"Y_red\", mu=red_hat, sigma=sigma, observed=y_obs_1)\n",
157+
" Y_blue = pm.Normal(\"Y_blue\", mu=blue_hat, sigma=sigma, observed=y_obs_2)\n",
158158
"\n",
159159
" return pmodel\n",
160160
"\n",
@@ -353,9 +353,9 @@
353353
],
354354
"metadata": {
355355
"kernelspec": {
356-
"display_name": "Python 3",
356+
"display_name": "Python (PyMC3 Dev)",
357357
"language": "python",
358-
"name": "python3"
358+
"name": "pymc3-dev"
359359
},
360360
"language_info": {
361361
"codemirror_mode": {
@@ -367,7 +367,7 @@
367367
"name": "python",
368368
"nbconvert_exporter": "python",
369369
"pygments_lexer": "ipython3",
370-
"version": "3.6.10"
370+
"version": "3.8.5"
371371
}
372372
},
373373
"nbformat": 4,

Diff for: examples/ode_models/ODE_with_manual_gradients.ipynb

+492-176
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)