pithist {countreg} | R Documentation |
PIT histograms graphically compare empirical probabilities from fitted models with a uniform distribution.
pithist(object, 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, ...)
object |
an object from which a |
type |
character. In case of discrete distributions should the PITs be drawn randomly from the corresponding interval or distributed proportionally? |
nsim |
integer. If |
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
|
PIT histograms graphically the probability integral transform (PIT),
i.e., observed probabilities from fitted probability models, with
a uniform distribution. It leverages the pit
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.
Czado C, Gneiting T, Held L (2009). “Predictive Model Assessment for Count Data.” Biometrics, 65(4), 1254–1261.
## count data regression models: crab satellites data("CrabSatellites", package = "countreg") cs_p <- glm(satellites ~ width + color, data = CrabSatellites, family = poisson) cs_hnb <- hurdle(satellites ~ 1 | width + color, data = CrabSatellites, dist = "negbin") ## PIT histograms par(mfrow = c(1, 2)) pithist(cs_p, ylim = c(0, 4.2)) pithist(cs_hnb, ylim = c(0, 4.2)) par(mfrow = c(1, 1))