topmodels {topmodels}R Documentation

Plotting Graphical Evaluation Tools for Probabilistic Models

Description

Plotting methods for probabilistic (regression) model objects supported by procast.

Usage

topmodels(object, flavor = NULL, newdata = NULL, na.action = na.pass, which = NULL, 
  ask = dev.interactive(), spar = TRUE, pages = NULL, ...)

Arguments

object

An object supported by "procast".

flavor

Should the rootogram be a base or ggplot2 style graphic, accordingly the invisible return value is either a data.frame or a tibble. Either set flavor expicitly to "base" vs. "tidyverse", or it's chosen automatically conditional if the packages ggplot2 and dplyr or tibble are loaded.

newdata

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

na.action

function determining what should be done with missing values in newdata. The default is to employ NA.

which

Character or integer, selects the type of plot: "rootogram" graphically compares (square roots) of empirical frequencies with fitted frequencies from a probability model, "pithist" compares empirical probabilities from fitted models with a uniform distribution, "reliagram" shows reliability diagram for assessing the reliability of a fitted probabilistic distributional forecast, "qqrplot" shows a quantile-quantile plot of quantile residuals, "wormplot" shows a worm plot again using quantile resiudals.

ask

For multiple plots, the user is asked to show the next plot.

spar

Should graphical parameters be set?

pages

For numeric one, all plots will be shown on a single page.

...

Arguments to be passed to rootogram, pithist, reliagram, qqrplot, and wormplot.

Details

FIXME

Value

FIXME

Examples

data("CrabSatellites", package = "countreg")
CrabSatellites2 <- CrabSatellites[CrabSatellites$satellites <= 1, ]

m1 <- glm(satellites ~ width + color, data = CrabSatellites, family = poisson)
m2 <- glm(satellites ~ width + color, data = CrabSatellites2, family = binomial)

## base graphics
topmodels(m1, pages = 1, flavor = "base")
topmodels(m1, pages = 1, nsim = 10, flavor = "base")
topmodels(m1, pages = 1, nsim = 30, fill = 2, flavor = "base")
topmodels(m1, pages = 1, nsim = 30, ref = 2, flavor = "base")
topmodels(m1, pages = 1, nsim = 30, fill =2, add_hist = 2, flavor = "base")

## ggplot2 graphics
topmodels(m1, pages = 1, nsim = 30, flavor = "tidyverse")
topmodels(m2, pages = 1, nsim = 30, flavor = "tidyverse")


[Package topmodels version 0.1-0 Index]