| Title: | Predictive Information Index ('PII') |
|---|---|
| Description: | A simple implementation of the Predictive Information Index ('PII'). |
| Authors: | Kevin E. Wells [aut, cre] |
| Maintainer: | Kevin E. Wells <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.0 |
| Built: | 2026-06-04 09:48:00 UTC |
| Source: | https://github.com/theotherdrwells/piir |
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"))pii(y, score_pred, full_pred = NULL, type = c("r2", "rm", "v"))
y |
Observed outcome vector. |
score_pred |
Predictions from score-based model. |
full_pred |
Predictions from the full model. |
type |
Character. One of "r2", "rm", or "v". |
A numeric value between 0 and 1.
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")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")
Plot Score vs Outcome for Visual PII Insight
pii_plot(score, outcome, bins = 10)pii_plot(score, outcome, bins = 10)
score |
Numeric score vector |
outcome |
Numeric outcome vector |
bins |
Number of bins for discretization |
A base R plot