## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## -----------------------------------------------------------------------------
library(gp3bayes)

p <- c(0.05, 0.20, 0.75, 0.90)
y <- c(0, 0, 1, 1)

binary_confusion_table(p, y)
binary_roc_curve(p, y)
binary_precision_recall_curve(p, y)
binary_calibration_error(p, y, bins = 2)

## ----eval=requireNamespace("ggplot2", quietly=TRUE)---------------------------
plot_binary_roc(binary_roc_curve(p, y))
plot_binary_precision_recall(binary_precision_recall_curve(p, y))

## ----eval=FALSE---------------------------------------------------------------
# pp <- predict_model(
#   fit,
#   type = "predictive",
#   include_group_effects = TRUE,
#   ndraws = 1000
# )
# 
# check <- posterior_predictive_statistic(pp, statistic = "mean")
# ppc_statistic_table(check)
# plot_ppc_statistic(check)

## ----eval=FALSE---------------------------------------------------------------
# duration_qq_table(pp)
# plot_duration_qq(pp)
# 
# tail <- duration_tail_check(pp, threshold = 2000)
# plot_duration_tail(tail)

