Skip to content

Commit 2af73d9

Browse files
authored
typo (#102)
1 parent bbeebe5 commit 2af73d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Chapters/Sensitivity_checks.qmd

+5-5
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Let's start by fitting a hierarchical model. The model is as follows:
298298
## PyMC
299299

300300
```{python}
301-
with pm.Model() as model:
301+
with pm.Model() as model_bt:
302302
μ = pm.Normal('μ', mu=0, sigma=10)
303303
β_week = pm.Normal('β_week', mu=0, sigma=10)
304304
β_trtDrug = pm.Normal('β_trtDrug', mu=0, sigma=10)
@@ -311,9 +311,9 @@ with pm.Model() as model:
311311
312312
y_obs = pm.Bernoulli('y_obs', logit_p=theta, observed=bacteria.y)
313313
314-
idata = pm.sample()
315-
pm.compute_log_prior(idata, var_names=["μ", "β_week", "β_trtDrug", "β_trtDrugP", "σ"])
316-
pm.compute_log_likelihood(idata)
314+
idata_bt = pm.sample()
315+
pm.compute_log_prior(idata_bt, var_names=["μ", "β_week", "β_trtDrug", "β_trtDrugP", "σ"])
316+
pm.compute_log_likelihood(idata_bt)
317317
```
318318

319319
## PyStan
@@ -329,7 +329,7 @@ From the power-scaling sensitivity analysis perspective the key element in the p
329329
Let's compute sensitivity diagnostics for all variables except `~b_Intercept`, if we want to check the sensitivity of all of them we can do it. The key point with hierarchical models is to not power-scale the lower level priors.
330330

331331
```{python}
332-
azs.psense_summary(dt, var_names=["~b_Intercept"])
332+
azs.psense_summary(idata_bt, var_names=["~b_Intercept"])
333333
```
334334
We see that everything looks fine. If you like to get potentials issues you could try running the model again with a prior like `σ = pm.HalfNormal('σ', sigma=1)`.
335335

0 commit comments

Comments
 (0)