## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## -----------------------------------------------------------------------------
library(gp3bayes)

binary_prediction_scores(
  c(0.05, 0.20, 0.75, 0.90),
  c(0, 0, 1, 1)
)

binary_threshold_metrics(
  c(0.05, 0.20, 0.75, 0.90),
  c(0, 0, 1, 1),
  thresholds = c(0.3, 0.5, 0.7)
)

duration_prediction_scores(
  c(900, 1100, 1300),
  c(950, 1050, 1400)
)

## ----eval=FALSE---------------------------------------------------------------
# grid <- create_prediction_grid(
#   fit,
#   at = list(condition = c("control", "treatment"))
# )
# 
# support <- audit_prediction_support(fit, grid)
# 
# expected <- predict_model(
#   fit,
#   newdata = grid,
#   type = "expected",
#   include_group_effects = FALSE
# )
# 
# predictive <- predict_model(
#   fit,
#   newdata = grid,
#   type = "predictive",
#   include_group_effects = FALSE,
#   ndraws = 1000
# )
# 
# prediction_table(expected)
# plot_prediction_intervals(expected)
# plot_prediction_support(support)

## ----eval=FALSE---------------------------------------------------------------
# p_binary <- predict_binary_probability(binary_fit)
# calibration <- binary_calibration_table(p_binary)
# plot_binary_calibration(calibration)
# 
# p_duration <- predict_duration(duration_fit, type = "predictive")
# duration_quantile_calibration(p_duration)
# duration_pit_table(p_duration)
# predictive_coverage_table(p_duration)

