pithist {topmodels}R Documentation

PIT Histograms for Assessing Goodness of Fit of Probability Models

Description

PIT histograms graphically compare empirical probabilities from fitted models with a uniform distribution.

Usage

pithist(object, ...)

## Default S3 method:
pithist(object, newdata = NULL, type = c("random", "proportional"), nsim = 1L,
  breaks = NULL, xlim = c(0, 1), ylim = NULL,
  xlab = "PIT", ylab = "Density", main = NULL,
  border = "black", fill = "lightgray", col = "#B61A51",
  lwd = 2, lty = 1, freq = FALSE, ...)

Arguments

object

an object from which probability integral transforms can be extracted with procast.

newdata

optionally, a data frame in which to look for variables with which to predict. If omitted, the original observations are used.

type

character. In case of discrete distributions should the PITs be drawn randomly from the corresponding interval or distributed proportionally?

nsim

integer. If type is "random" how many simulated PITs should be drawn?

breaks

numeric. Breaks for the histogram intervals.

xlab, ylab, main

graphical parameters.

xlim, ylim, border, fill, col, lwd, lty

graphical parameters. These may pertain either to the whole plot or just the histogram or just the fitted line.

freq, ...

further arguments passed to hist.

Details

PIT histograms graphically the probability integral transform (PIT), i.e., observed probabilities from fitted probability models, with a uniform distribution. It leverages the procast generic and then essentially draws a hist.

In case of discrete distributions the PIT is either drawn randomly from the corresponding interval or distributed proportionally in the histogram (FIXME: not yet implemented).

References

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

See Also

procast, hist

Examples

## linear regression models (homoscedastic Gaussian response)
m <- lm(dist ~ speed, data = cars)
plot(m)

[Package topmodels version 0.0-1 Index]