pitw compares a set
of continuous predictive distributions with the values they were meant
to predict. For example, given forecasts of a hospital admission rate
and the corresponding observed rates, we can check whether the
predictive distributions tend to be too narrow or too wide after
accounting for a common location bias.
For each observation, the probability integral transform (PIT) gives the proportion of its predictive distribution below the observed value. For calibrated continuous predictions these proportions should be uniform between zero and one. The package summarises departures from uniformity in three ways.
| Score | Interpretation |
|---|---|
B_pit |
Overall departure from uniformity in the original PIT values. Bias, spread and distribution shape can all contribute. |
U_pit |
Departure that remains after estimating and adjusting for one common location shift. |
D_pit |
Direction of the remaining spread discrepancy. Positive values indicate overconfidence and negative values indicate underconfidence. |
We use 100 reference quantiles of a standard normal distribution as example observations. Each forecast is normal with mean 0.5 and standard deviation 0.7, so the forecasts are displaced and too narrow by construction.
observed <- stats::qnorm(stats::ppoints(100))
pitw::pit_w(true_value = observed, location = 0.5, scale = 0.7)## # A tibble: 1 × 5
## B_pit U_pit D_pit adjust link
## <dbl> <dbl> <dbl> <chr> <chr>
## 1 0.159 0.0556 0.0556 link identity
The positive D_pit shows that the forecasts are too
narrow after adjustment for the common shift. This example illustrates
the scores. The significance tests use large-sample reference
distributions and assume independent predictions, which matters when
forecasts or estimates use overlapping data.
pit_w() scores one set of predictions. Use
prediction_scores() to score several sets in a grouped data
frame and compare the PIT scores with coverage, interval width and the
continuous ranked probability score (CRPS).