For those familiar with least squares estimation, there's a good answer here that relates it with the Kalman filter
http://dsp.stackexchange.com/a/2398
It's a little simpler to derive the least squares smoothing function http://stats.stackexchange.com/a/138342