Build a square moving average window (KNN in 1d). This is a high-frequency feature.
square_window(varName, x, y, w = NULL)
character, name of variable
numeric input (not empty, no NAs).
numeric or castable to such (same length as x no NAs), output to match
numeric positive, same length as x (weights, can be NULL) IGNORED
segmented y prediction