quivers.diagnostics.predictive_checks¶
Posterior-predictive p-values and LOO-PIT calibration.
predictive_checks
¶
Posterior-predictive checks (PPCs) and calibration diagnostics.
ArviZ ships arviz.plot_ppc, arviz.loo_pit, and a
broad family of PPC visualisations. This module exposes a small
typed surface that delegates to those, and adds a registry of
common test statistics that map cleanly onto quivers' plate-and-
group structure (per-Verb mean, per-Subject sd, etc.).
posterior_predictive_check
¶
posterior_predictive_check(idata: DataTree, *, observed_name: str, statistic: str | Callable[[ndarray], float] = 'mean', by: str | None = None) -> Mapping[str, float | ndarray | str]
Compute a posterior-predictive p-value (PPP-value) for a user-chosen test statistic.
| PARAMETER | DESCRIPTION |
|---|---|
idata
|
Fit produced by
TYPE:
|
observed_name
|
Name of the observed site (must appear in both groups).
TYPE:
|
statistic
|
Either a key into
TYPE:
|
by
|
If given, computes the statistic per group along the named
dim (e.g.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Mapping[str, float or ndarray]
|
|
Source code in src/quivers/diagnostics/predictive_checks.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
loo_pit
¶
loo_pit(idata: DataTree, *, observed_name: str)
Leave-one-out probability-integral-transform calibration.
Delegates to arviz.loo_pit. Returns the PIT values; the
canonical use is arviz.plot_loo_pit for the calibration
diagnostic plot.
Source code in src/quivers/diagnostics/predictive_checks.py
123 124 125 126 127 128 129 130 131 132 133 134 | |