Say we have group $0$ distributed as $N(\mu, \sigma^2)$ and group $1$ distributed as $N(\mu+\delta, \sigma^2)$. We then use the Gaussian-distributed variables to predict group membership. It seems like we should have some way to relate $\delta\big/\sigma^2$ to the area under the receiver-operator characteristic curve, and a simulation supports this idea.
library(pROC)
library(ggplot2)
set.seed(2024)
N <- 100000#0 # A million took longer than I wanted
deltas <- seq(-4, 4, 0.1)
aucs <- rep(NA, length(deltas))
for (i in 1:length(deltas)){
# Standardize variance to 1
#
x0 <- rnorm(N, 0, 1)
x1 <- rnorm(N, 0 + deltas[i], 1)
y0 <- rep(0, N)
y1 <- rep(1, N)
x <- c(x0, x1)
y <- c(y0, y1)
r <- pROC::roc(y, x, direction = "<")
aucs[i] <- r$auc
print(paste(
i/length(deltas)*100,
"% complete",
sep = ""
))
}
d <- data.frame(
Delta = abs(deltas),
ROCAUC = aucs
)
ggplot(d, aes(y = Delta, x = ROCAUC)) +
geom_point()
Mathematically, what is this relationship, and how specific is it to Gaussians?
