I wrote this [http://www.tina-vision.net/docs/memos/1996-002.pdf] many years ago which derives the Kalman filter from a state space perspective and then as chi-squared merit function. Certainly helped me as an engineer appreciate the statistical underpinnings.