Skip to content

Commit 46874d5

Browse files
committed
add admonition blocks about use of random_seed kwarg
1 parent 8f9591a commit 46874d5

10 files changed

+117
-11
lines changed

docs/notebooks/ancova_pymc.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@
219219
"source": [
220220
"## Run the analysis\n",
221221
"\n",
222-
"Note: passing in a random seed is not required. We do it here for reproducibilty."
222+
"<div class=\"alert alert-info\">\n",
223+
"\n",
224+
"Note:\n",
225+
"\n",
226+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
227+
"\n",
228+
"</div>"
223229
]
224230
},
225231
{
@@ -373,7 +379,7 @@
373379
"name": "python",
374380
"nbconvert_exporter": "python",
375381
"pygments_lexer": "ipython3",
376-
"version": "3.10.8"
382+
"version": "3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:29) [Clang 14.0.6 ]"
377383
},
378384
"orig_nbformat": 4,
379385
"vscode": {

docs/notebooks/did_pymc.ipynb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,19 @@
144144
]
145145
},
146146
{
147+
"attachments": {},
147148
"cell_type": "markdown",
148149
"metadata": {},
149150
"source": [
150-
"## Run the analysis"
151+
"## Run the analysis\n",
152+
"\n",
153+
"<div class=\"alert alert-info\">\n",
154+
"\n",
155+
"Note:\n",
156+
"\n",
157+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
158+
"\n",
159+
"</div>"
151160
]
152161
},
153162
{

docs/notebooks/did_pymc_banks.ipynb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,20 @@
387387
"First we'll do an analysis just looking at data from 1930 and 1931. This way we just have a single pre-intervention and a single post-intervention measurement."
388388
]
389389
},
390+
{
391+
"attachments": {},
392+
"cell_type": "markdown",
393+
"metadata": {},
394+
"source": [
395+
"<div class=\"alert alert-info\">\n",
396+
"\n",
397+
"Note:\n",
398+
"\n",
399+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
400+
"\n",
401+
"</div>"
402+
]
403+
},
390404
{
391405
"cell_type": "code",
392406
"execution_count": 7,

docs/notebooks/geolift1.ipynb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,15 @@
265265
"\n",
266266
"So there is no magic involved - we simply estimate a synthetic Denmark as a weighted sum of the untreated units. We do this based on the 'training' data observed before the intervention. We then use that weighted sum model to predict our synthetic Denmark based on 'test' data of untreated countries observed after the intervention. We can then simply compare this counterfactual estimate with the observed sales data in Denmark and obtain our estimate of the causal impact. We can then (optionally) calculate the cumulative causal impact to answer the question \"How many more sales were caused by the store refurbishment over 2022?\"\n",
267267
"\n",
268-
"We can use `CausalPy`'s API to run this procedure, but using Bayesian inference methods as follows:"
268+
"We can use `CausalPy`'s API to run this procedure, but using Bayesian inference methods as follows:\n",
269+
"\n",
270+
"<div class=\"alert alert-info\">\n",
271+
"\n",
272+
"Note:\n",
273+
"\n",
274+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
275+
"\n",
276+
"</div>"
269277
]
270278
},
271279
{
@@ -595,7 +603,7 @@
595603
"name": "python",
596604
"nbconvert_exporter": "python",
597605
"pygments_lexer": "ipython3",
598-
"version": "3.10.8"
606+
"version": "3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:29) [Clang 14.0.6 ]"
599607
},
600608
"orig_nbformat": 4,
601609
"vscode": {

docs/notebooks/its_covid.ipynb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,21 @@
168168
]
169169
},
170170
{
171+
"attachments": {},
171172
"cell_type": "markdown",
172173
"metadata": {},
173174
"source": [
174175
"## Run the analysis\n",
175176
"\n",
176-
"In this example we are going to standardize the data. So we have to be careful in how we interpret the inferred regression coefficients, and the posterior predictions will be in this standardized space."
177+
"In this example we are going to standardize the data. So we have to be careful in how we interpret the inferred regression coefficients, and the posterior predictions will be in this standardized space.\n",
178+
"\n",
179+
"<div class=\"alert alert-info\">\n",
180+
"\n",
181+
"Note:\n",
182+
"\n",
183+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
184+
"\n",
185+
"</div>"
177186
]
178187
},
179188
{
@@ -301,7 +310,7 @@
301310
"name": "python",
302311
"nbconvert_exporter": "python",
303312
"pygments_lexer": "ipython3",
304-
"version": "3.10.8"
313+
"version": "3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:29) [Clang 14.0.6 ]"
305314
},
306315
"orig_nbformat": 4,
307316
"vscode": {

docs/notebooks/rd_pymc.ipynb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@
3737
"df = cp.load_data(\"rd\")"
3838
]
3939
},
40+
{
41+
"attachments": {},
42+
"cell_type": "markdown",
43+
"metadata": {},
44+
"source": [
45+
"<div class=\"alert alert-info\">\n",
46+
"\n",
47+
"Note:\n",
48+
"\n",
49+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
50+
"\n",
51+
"</div>"
52+
]
53+
},
4054
{
4155
"cell_type": "code",
4256
"execution_count": 4,

docs/notebooks/rd_pymc_drinking.ipynb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@
7474
"To be clear, $\\beta_2 a$ describes a linear trend of how expected mortality rate changes with age. The coefficient $\\beta_0$ is the intercept of this linear trend (at $a=0$). This leaves $\\beta_1 t(a)$ which we can understand as modelling the discontinuity of the linear trend around the age threshold. "
7575
]
7676
},
77+
{
78+
"attachments": {},
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"<div class=\"alert alert-info\">\n",
83+
"\n",
84+
"Note:\n",
85+
"\n",
86+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
87+
"\n",
88+
"</div>"
89+
]
90+
},
7791
{
7892
"cell_type": "code",
7993
"execution_count": 3,

docs/notebooks/sc2_pymc.ipynb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,19 @@
150150
]
151151
},
152152
{
153+
"attachments": {},
153154
"cell_type": "markdown",
154155
"metadata": {},
155156
"source": [
156-
"Run the analysis"
157+
"Run the analysis\n",
158+
"\n",
159+
"<div class=\"alert alert-info\">\n",
160+
"\n",
161+
"Note:\n",
162+
"\n",
163+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
164+
"\n",
165+
"</div>"
157166
]
158167
},
159168
{

docs/notebooks/sc_pymc.ipynb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,19 @@
4848
]
4949
},
5050
{
51+
"attachments": {},
5152
"cell_type": "markdown",
5253
"metadata": {},
5354
"source": [
54-
"## Run the analysis"
55+
"## Run the analysis\n",
56+
"\n",
57+
"<div class=\"alert alert-info\">\n",
58+
"\n",
59+
"Note:\n",
60+
"\n",
61+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
62+
"\n",
63+
"</div>"
5564
]
5665
},
5766
{
@@ -391,7 +400,7 @@
391400
"name": "python",
392401
"nbconvert_exporter": "python",
393402
"pygments_lexer": "ipython3",
394-
"version": "3.10.8"
403+
"version": "3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:29) [Clang 14.0.6 ]"
395404
},
396405
"orig_nbformat": 4,
397406
"vscode": {

docs/notebooks/sc_pymc_brexit.ipynb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@
216216
"print(formula)"
217217
]
218218
},
219+
{
220+
"attachments": {},
221+
"cell_type": "markdown",
222+
"metadata": {},
223+
"source": [
224+
"<div class=\"alert alert-info\">\n",
225+
"\n",
226+
"Note:\n",
227+
"\n",
228+
"The `random_seed` keyword argument for the PyMC sampler is not neccessary. We use it here so that the results are reproducible.\n",
229+
"\n",
230+
"</div>"
231+
]
232+
},
219233
{
220234
"cell_type": "code",
221235
"execution_count": 10,
@@ -725,7 +739,7 @@
725739
"name": "python",
726740
"nbconvert_exporter": "python",
727741
"pygments_lexer": "ipython3",
728-
"version": "3.10.8"
742+
"version": "3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:29) [Clang 14.0.6 ]"
729743
},
730744
"orig_nbformat": 4,
731745
"vscode": {

0 commit comments

Comments
 (0)