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

## -----------------------------------------------------------------------------
truth <- c(1.0, 1.4, 2.0, 2.5, 3.0, 3.6)
prediction <- c(1.1, 1.3, 2.2, 2.4, 2.9, 3.4)
participant <- c("P1","P1","P2","P2","P3","P3")

fit <- fit_gazepoint_conformal(
  truth = truth,
  prediction = prediction,
  task_type = "regression",
  level = 0.90,
  calibration_unit = "participant",
  unit = participant,
  generalization_target = "new_participants"
)

interval <- predict_gazepoint_interval(fit, prediction)
coverage <- assess_gazepoint_conformal_coverage(
  fit, truth = truth, interval = interval, unit = participant
)

coverage
plot(coverage)

