powered by
Computes the Predictive Information Index using one of three methods: "r2" (R-squared ratio), "rm" (RMSE-based), or "v" (variance ratio).
pii(y, score_pred, full_pred = NULL, type = c("r2", "rm", "v"))
A numeric value between 0 and 1.
Observed outcome vector.
Predictions from score-based model.
Predictions from the full model.
Character. One of "r2", "rm", or "v".
set.seed(1) y <- rnorm(100) full <- y + rnorm(100, sd = 0.3) score <- y + rnorm(100, sd = 0.5) pii(y, score, full, type = "r2") pii(y, score, full, type = "rm") pii(y, score, full, type = "v")
Run the code above in your browser using DataLab