Learn R Programming

piiR (version 0.3.0)

pii: Predictive Information Index (PII)

Description

Computes the Predictive Information Index using one of three methods: "r2" (R-squared ratio), "rm" (RMSE-based), or "v" (variance ratio).

Usage

pii(y, score_pred, full_pred = NULL, type = c("r2", "rm", "v"))

Value

A numeric value between 0 and 1.

Arguments

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".

Examples

Run this code
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