Skip to content

Commit ff6f292

Browse files
authored
Add coverage plot to PPC chapter (#115)
1 parent f40b542 commit ff6f292

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Chapters/Prior_posterior_predictive_checks.qmd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,20 @@ azp.plot_ppc_pit(idata_i,
358358
);
359359
```
360360

361+
Alternatively, we can visualize the coverage of the central posterior credible intervals by setting ``coverage=True``. This allows us to assess whether the credible intervals includes the observed values.
362+
363+
- If the difference is **positive**, the model is **under-confident**: the predictions have a wider spread than the data -- they are **too uncertain**.
364+
- If the difference is **negative**, the model is **over-confident**: the predictions have a narrower spread than the data -- they are **too certain**.
365+
366+
```{python}
367+
#| label: fig-post_ppc_pit_coverage
368+
#| fig-cap: "Coverage check showing four alternative scenarios."
369+
azp.plot_ppc_pit(idata_i,
370+
coverage=True,
371+
plot_kwargs={"ylabel":False},
372+
pc_kwargs={"plot_grid_kws":{"sharey":True}},
373+
);
374+
```
361375

362376
### Avoiding double-dipping
363377

0 commit comments

Comments
 (0)