Skip to content

Commit 885fb46

Browse files
Replacing PyMC3 plots w/ Arviz plots & sigma Param change [Part 4] (#24)
* 🎨 Update plots from pymc to arviz dependencies & replace param sd with sigma ⏪ Revert changes due to improper metadata updates 🎨 Fix divergence in last cells and outdated errors due to variou package changes * 🔀 Prep to resolve merge conflict on GLM Linear notebook
1 parent 1ba7529 commit 885fb46

8 files changed

+1010
-976
lines changed

Diff for: examples/gaussian_processes/GP-Kron.ipynb

+6-8
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
" # Place a GP prior over the function f.\n",
341341
" f = gp.prior(\"f\", Xs=Xs)\n",
342342
"\n",
343-
" y_ = pm.Normal(\"y_\", mu=f, sd=sigma, observed=y)"
343+
" y_ = pm.Normal(\"y_\", mu=f, sigma=sigma, observed=y)"
344344
]
345345
},
346346
{
@@ -448,7 +448,7 @@
448448
}
449449
],
450450
"source": [
451-
"pm.traceplot(\n",
451+
"az.plot_trace(\n",
452452
" tr,\n",
453453
" var_names=[\"ls1\", \"ls2\", \"eta\", \"sigma\"],\n",
454454
" lines={\"ls1\": l1_true, \"ls2\": l2_true, \"eta\": eta_true, \"sigma\": sigma_true},\n",
@@ -562,9 +562,7 @@
562562
{
563563
"cell_type": "code",
564564
"execution_count": 14,
565-
"metadata": {
566-
"scrolled": false
567-
},
565+
"metadata": {},
568566
"outputs": [
569567
{
570568
"name": "stdout",
@@ -631,9 +629,9 @@
631629
],
632630
"metadata": {
633631
"kernelspec": {
634-
"display_name": "Python 3",
632+
"display_name": "Python (PyMC3 Dev)",
635633
"language": "python",
636-
"name": "python3"
634+
"name": "pymc3-dev"
637635
},
638636
"language_info": {
639637
"codemirror_mode": {
@@ -645,7 +643,7 @@
645643
"name": "python",
646644
"nbconvert_exporter": "python",
647645
"pygments_lexer": "ipython3",
648-
"version": "3.7.7"
646+
"version": "3.8.5"
649647
}
650648
},
651649
"nbformat": 4,

Diff for: examples/gaussian_processes/GP-Latent.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
},
105105
"outputs": [],
106106
"source": [
107+
"import warnings\n",
108+
"\n",
107109
"import arviz as az\n",
108110
"import matplotlib.pyplot as plt\n",
109111
"import numpy as np\n",
@@ -129,8 +131,6 @@
129131
"metadata": {},
130132
"outputs": [],
131133
"source": [
132-
"import warnings\n",
133-
"\n",
134134
"# mute future warnings from theano\n",
135135
"warnings.simplefilter(action=\"ignore\", category=FutureWarning)"
136136
]
@@ -996,9 +996,9 @@
996996
"metadata": {
997997
"anaconda-cloud": {},
998998
"kernelspec": {
999-
"display_name": "Python 3",
999+
"display_name": "Python (PyMC3 Dev)",
10001000
"language": "python",
1001-
"name": "python3"
1001+
"name": "pymc3-dev"
10021002
},
10031003
"language_info": {
10041004
"codemirror_mode": {
@@ -1010,7 +1010,7 @@
10101010
"name": "python",
10111011
"nbconvert_exporter": "python",
10121012
"pygments_lexer": "ipython3",
1013-
"version": "3.8.3"
1013+
"version": "3.8.5"
10141014
}
10151015
},
10161016
"nbformat": 4,

Diff for: examples/generalized_linear_models/GLM-hierarchical-binominal-model.ipynb

+59-58
Large diffs are not rendered by default.

Diff for: examples/generalized_linear_models/GLM-hierarchical.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@
467467
}
468468
],
469469
"source": [
470-
"pm.traceplot(hierarchical_trace, var_names=[\"mu_a\", \"mu_b\", \"sigma_a\", \"sigma_b\", \"eps\"]);"
470+
"az.plot_trace(hierarchical_trace, var_names=[\"mu_a\", \"mu_b\", \"sigma_a\", \"sigma_b\", \"eps\"]);"
471471
]
472472
},
473473
{
@@ -500,7 +500,7 @@
500500
}
501501
],
502502
"source": [
503-
"pm.traceplot(hierarchical_trace, var_names=[\"a\"], coords={\"a_dim_0\": range(5)});"
503+
"az.plot_trace(hierarchical_trace, var_names=[\"a\"], coords={\"a_dim_0\": range(5)});"
504504
]
505505
},
506506
{
@@ -764,7 +764,7 @@
764764
"name": "python",
765765
"nbconvert_exporter": "python",
766766
"pygments_lexer": "ipython3",
767-
"version": "3.7.7"
767+
"version": "3.8.5"
768768
},
769769
"latex_envs": {
770770
"bibliofile": "biblio.bib",

Diff for: examples/generalized_linear_models/GLM-linear.ipynb

+37-19
Large diffs are not rendered by default.

Diff for: examples/generalized_linear_models/GLM-logistic.ipynb

+81-64
Large diffs are not rendered by default.

Diff for: examples/generalized_linear_models/GLM-model-selection.ipynb

+561-623
Large diffs are not rendered by default.

Diff for: examples/generalized_linear_models/GLM-robust-with-outlier-detection.ipynb

+258-196
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)