pit.hist: Probability Integral Transform Histogram

View source: R/pit.hist.R

pit.histR Documentation

Probability Integral Transform Histogram

Description

This function plots the Probability Integral Transform (PIT) Histogram for a predictive distribution.

Usage

pit.hist(
  u,
  bins = NULL,
  type = "density",
  title = "PIT Histogram",
  dispersion = FALSE,
  bias = FALSE,
  na.action = na.omit
)

Arguments

u

vector of PIT values in [0,1] (see details)

bins

numeric; number of bins; default: bins = round(sqrt(length(u))) (see details)

type

character; "relative", "absolute" and "density"; default: "density" (see details)

title

character; title of the plot; default: "PIT Histogram"

dispersion

logical; if TRUE the variance of the PIT values is calculated for the plot (see details); if FALSE the variance of the PIT values is not calculated; default: FALSE

bias

logical; if TRUE the expectation of the PIT values is calculated for the plot (see details); if FALSE the expectation of the PIT values is not calculated; default: FALSE

na.action

function to handle the NA's. Default: na.omit.

Details

The vector u contains the PIT values u=F(x) for a predictive distribution F evaluated at x.

The parameter bins specifies the number of columns for the PIT histogram.

If type is "relative" the relative frequencies of the bins are plotted. If type is "absolute" the absolute frequencies of the bins are plotted. If type is "density" the relative densities of the bins are plotted.

An uniform PIT histogram indicates a calibrated predictive distribution. A ∩-shape in the PIT histogram indicates overdispersion and a ∪-shape indicates underdispersion of the predictive distribution. A systematic bias of the predictive distribution results in a triangular shaped PIT histogram.

The variance of the PIT values (Var(PIT)) provides information on the dispersion of a predictive distribution subject to calibration. A variance of the PIT values equal to 1/12 ≈ 0.0833 corresponds to the variance of the uniform distribution on [0,1], which is desirable. A variance greater than 1/12 indicates underdispersion and a variance smaller than 1/12 indicates overdispersion of the predictive distribution.

The expectation value of the PIT values (E(PIT)) provides information on the bias of a predictive distribution subject to calibration. An expectation of the PIT values equal to 1/2 corresponds to the expectation of the uniform distribution on [0,1], which is desirable. Any deviation from 1/2 indicates that the predictive distribution is biased.

Value

ggplot object with a plot of the PIT histogram.

Author(s)

David Jobst

References

Dawid, A. (1984). Present Position and Potential Developments: Some Personal Views: Statistical Theory: The Prequential Approach. 147(2), 278-292.

Gneiting, T., Balabdaoui, F. and Raftery, A. (2007). Probabilistic forecasts, calibration and sharpness. Journal of the Royal Statistical Society, Series B, Statistical Methodology. 69, 243–268.

Czado, C., Gneiting, T. and Held, L. (2009). Predictive Model Assessment for Count Data. Biometrics, 65(4), 1254–1261.

Gneiting, T. and Ranjan, R. (2013). Combining predictive distributions. Electronic Journal of Statistics, 7, 1747-1782.

Examples

# simulated data
n <- 10000
u <- runif(n)

# pit plot
pit.hist(u = u)
pit.hist(u = u, bins = 5, title = "PITH", dispersion = TRUE, bias = FALSE)
pit.hist(u = u, bins = 5, type = "relative", dispersion = FALSE, bias = TRUE)
pit.hist(u = u, bins = 5, type = "absolute", dispersion = TRUE, bias = TRUE)



jobstdavid/eppverification documentation built on May 13, 2024, 5:20 p.m.