Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 116 additions & 169 deletions examples/causal_inference/interrupted_time_series.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/causal_inference/interrupted_time_series.myst.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jupytext:
format_name: myst
format_version: 0.13
kernelspec:
display_name: pymc_env
display_name: Python (pymc-examples)
language: python
name: pymc_env
name: pymc-examples
---

(interrupted_time_series)=
Expand Down Expand Up @@ -121,7 +121,7 @@ treatment_time = "2017-01-01"
β0 = 0
β1 = 0.1
dates = pd.date_range(
start=pd.to_datetime("2010-01-01"), end=pd.to_datetime("2020-01-01"), freq="M"
start=pd.to_datetime("2010-01-01"), end=pd.to_datetime("2020-01-01"), freq="ME"
)
N = len(dates)

Expand Down Expand Up @@ -163,7 +163,7 @@ Here we build a simple linear model. Remember that we are building a model of th
```{code-cell} ipython3
with pm.Model() as model:
# observed predictors and outcome
time = pm.MutableData("time", pre["time"].to_numpy(), dims="obs_id")
time = pm.Data("time", pre["time"].to_numpy(), dims="obs_id")
# priors
beta0 = pm.Normal("beta0", 0, 1)
beta1 = pm.Normal("beta1", 0, 0.2)
Expand Down Expand Up @@ -354,7 +354,7 @@ There are of course many ways that the interrupted time series approach could be

```{code-cell} ipython3
%load_ext watermark
%watermark -n -u -v -iv -w -p pytensor,aeppl,xarray
%watermark -n -u -v -iv -w -p pytensor,xarray
```

:::{include} ../page_footer.md
Expand Down