# Compute the error - spread 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),
x3 = c(3, 3, -3, -3, 0, 0)
)
df$errorspread_penalty <- errorspread_sf(x1 = df$x1, x2 = df$x2, x3 = df$x3,
y = df$y)
print(df)
Run the code above in your browser using DataLab