## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(gp3bayes)

## -----------------------------------------------------------------------------
plan <- create_sensitivity_suite_plan(
  prior_scale = TRUE,
  powerscale = TRUE,
  psis_loo = TRUE
)
plan

## ----eval=FALSE---------------------------------------------------------------
# suite <- run_sensitivity_suite(
#   fit,
#   plan,
#   stop_on_error = FALSE
# )
# 
# summarise_sensitivity_suite(suite)
# plot(suite)

## ----eval=FALSE---------------------------------------------------------------
# random_slope_plan <- create_random_slope_sensitivity_plan(specification)
# group_plan <- create_group_deletion_sensitivity_plan(
#   specification,
#   group = "participant",
#   units = c("p001", "p002")
# )
# 
# plan <- create_sensitivity_suite_plan(
#   prior_scale = TRUE,
#   psis_loo = TRUE,
#   random_slope_plan = random_slope_plan,
#   group_deletion_plan = group_plan
# )

## ----eval=FALSE---------------------------------------------------------------
# evidence <- collect_model_evidence(
#   fit = fit,
#   design = design,
#   diagnostics = diagnostics,
#   posterior = posterior,
#   ppc = ppc,
#   estimands = estimands,
#   loo = loo_result,
#   sensitivity = suite,
#   manifest = frozen_manifest
# )
# 
# evidence
# plot(evidence)

## ----eval=FALSE---------------------------------------------------------------
# report <- tempfile(fileext = ".md")
# create_model_evidence_report(evidence, report)
# unlink(report)

