A maximum-likelihood Kalman filter for switching discrete-time linear systems