Skip to content

Commit 78f5794

Browse files
authored
Multiple updates to v5 (pymc-devs#516)
* update notebooks authored by Ben Vincent to v5
1 parent cef367c commit 78f5794

20 files changed

+1688
-1485
lines changed

examples/case_studies/mediation_analysis.ipynb

Lines changed: 260 additions & 235 deletions
Large diffs are not rendered by default.

examples/case_studies/mediation_analysis.myst.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jupytext:
55
format_name: myst
66
format_version: 0.13
77
kernelspec:
8-
display_name: Python 3 (ipykernel)
8+
display_name: pymc_env
99
language: python
10-
name: python3
10+
name: pymc_env
1111
---
1212

1313
(mediation_analysis)=
@@ -182,7 +182,7 @@ with pm.Model() as total_effect_model:
182182
c = pm.Normal("c", mu=0, sigma=1)
183183
σy = pm.HalfCauchy("σy", 1)
184184
μy = iy + c * _x
185-
pm.Normal("yy", mu=μy, sd=σy, observed=y, dims="obs_id")
185+
pm.Normal("yy", mu=μy, sigma=σy, observed=y, dims="obs_id")
186186
```
187187

188188
```{code-cell} ipython3

examples/case_studies/moderation_analysis.ipynb

Lines changed: 138 additions & 131 deletions
Large diffs are not rendered by default.

examples/case_studies/moderation_analysis.myst.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jupytext:
55
format_name: myst
66
format_version: 0.13
77
kernelspec:
8-
display_name: pymc-dev-py39
8+
display_name: pymc_env
99
language: python
10-
name: pymc-dev-py39
10+
name: pymc_env
1111
---
1212

1313
(moderation_analysis)=
@@ -234,13 +234,13 @@ def model_factory(x, m, y):
234234
x = pm.ConstantData("x", x)
235235
m = pm.ConstantData("m", m)
236236
# priors
237-
β0 = pm.Normal("β0", mu=0, sd=10)
238-
β1 = pm.Normal("β1", mu=0, sd=10)
239-
β2 = pm.Normal("β2", mu=0, sd=10)
240-
β3 = pm.Normal("β3", mu=0, sd=10)
237+
β0 = pm.Normal("β0", mu=0, sigma=10)
238+
β1 = pm.Normal("β1", mu=0, sigma=10)
239+
β2 = pm.Normal("β2", mu=0, sigma=10)
240+
β3 = pm.Normal("β3", mu=0, sigma=10)
241241
σ = pm.HalfCauchy("σ", 1)
242242
# likelihood
243-
y = pm.Normal("y", mu=β0 + (β1 * x) + (β2 * x * m) + (β3 * m), sd=σ, observed=y, dims="obs")
243+
y = pm.Normal("y", mu=β0 + (β1 * x) + (β2 * x * m) + (β3 * m), sigma=σ, observed=y)
244244
245245
return model
246246
```
@@ -361,6 +361,7 @@ But readers are strongly encouraged to read {cite:t}`mcclelland2017multicollinea
361361
## Authors
362362
- Authored by Benjamin T. Vincent in June 2021
363363
- Updated by Benjamin T. Vincent in March 2022
364+
- Updated by Benjamin T. Vincent in February 2023 to run on PyMC v5
364365

365366
+++
366367

examples/causal_inference/difference_in_differences.ipynb

Lines changed: 132 additions & 110 deletions
Large diffs are not rendered by default.

examples/causal_inference/difference_in_differences.myst.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ Of course, when using the difference in differences approach for real applicatio
437437

438438
## Authors
439439
- Authored by [Benjamin T. Vincent](https://github.com/drbenvincent) in Sept 2022 ([#424](https://github.com/pymc-devs/pymc-examples/pull/424)).
440+
- Updated by Benjamin T. Vincent in February 2023 to run on PyMC v5
440441

441442
+++
442443

examples/causal_inference/excess_deaths.ipynb

Lines changed: 242 additions & 218 deletions
Large diffs are not rendered by default.

examples/causal_inference/excess_deaths.myst.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ The bad news of course, is that as of the last data point (May 2022) the number
488488

489489
## Authors
490490
- Authored by [Benjamin T. Vincent](https://github.com/drbenvincent) in July 2022.
491+
- Updated by Benjamin T. Vincent in February 2023 to run on PyMC v5
491492

492493
+++
493494

examples/causal_inference/interrupted_time_series.ipynb

Lines changed: 116 additions & 94 deletions
Large diffs are not rendered by default.

examples/causal_inference/interrupted_time_series.myst.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ There are of course many ways that the interrupted time series approach could be
348348

349349
## Authors
350350
- Authored by [Benjamin T. Vincent](https://github.com/drbenvincent) in October 2022.
351+
- Updated by Benjamin T. Vincent in February 2023 to run on PyMC v5
351352

352353
+++
353354

0 commit comments

Comments
 (0)