Skip to content

Commit e1e064d

Browse files
Update interrupted time series notebook for PyMC v5 and Pandas compat… (#831)
* Update interrupted time series notebook for PyMC v5 and Pandas compatibility * Rerun notebook sequentially and update watermark
1 parent ab02b57 commit e1e064d

File tree

2 files changed

+121
-174
lines changed

2 files changed

+121
-174
lines changed

examples/causal_inference/interrupted_time_series.ipynb

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

examples/causal_inference/interrupted_time_series.myst.md

Lines changed: 5 additions & 5 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_env
8+
display_name: Python (pymc-examples)
99
language: python
10-
name: pymc_env
10+
name: pymc-examples
1111
---
1212

1313
(interrupted_time_series)=
@@ -121,7 +121,7 @@ treatment_time = "2017-01-01"
121121
β0 = 0
122122
β1 = 0.1
123123
dates = pd.date_range(
124-
start=pd.to_datetime("2010-01-01"), end=pd.to_datetime("2020-01-01"), freq="M"
124+
start=pd.to_datetime("2010-01-01"), end=pd.to_datetime("2020-01-01"), freq="ME"
125125
)
126126
N = len(dates)
127127
@@ -163,7 +163,7 @@ Here we build a simple linear model. Remember that we are building a model of th
163163
```{code-cell} ipython3
164164
with pm.Model() as model:
165165
# observed predictors and outcome
166-
time = pm.MutableData("time", pre["time"].to_numpy(), dims="obs_id")
166+
time = pm.Data("time", pre["time"].to_numpy(), dims="obs_id")
167167
# priors
168168
beta0 = pm.Normal("beta0", 0, 1)
169169
beta1 = pm.Normal("beta1", 0, 0.2)
@@ -354,7 +354,7 @@ There are of course many ways that the interrupted time series approach could be
354354

355355
```{code-cell} ipython3
356356
%load_ext watermark
357-
%watermark -n -u -v -iv -w -p pytensor,aeppl,xarray
357+
%watermark -n -u -v -iv -w -p pytensor,xarray
358358
```
359359

360360
:::{include} ../page_footer.md

0 commit comments

Comments
 (0)