Nadaraya-Watson kernel smoothing as a random energy model