# Compute the mean - variance scoring function.
df <- data.frame(
y = rep(x = 0, times = 6),
x1 = c(2, 2, -2, -2, 0, 0),
x2 = c(1, 2, 1, 2, 1, 2)
)
df$mv_penalty <- mv_sf(x1 = df$x1, x2 = df$x2, y = df$y)
print(df)
Run the code above in your browser using DataLab