Lab meeting 6/27/2011

This week I followed up on the previous week’s meeting about state-space models with a tutorial on Kalman filtering / smoothing.  We started with three Gaussian “fun facts” about linear transformations of Gaussian random variables and products of Gaussian densities.  Then we derived the Kalman filtering equations, the EM algorithm, and discussed a simple implementation of Kalman smoothing using sparse matrices and the “backslash” operator in matlab.

Here’s how to do Kalman smoothing in one line of matlab:
Xmap = (Qinv + speye(nsamps) / varY) \  (Y / varY +  Qinv * muX);

where the latent variable X has prior mean muX and inverse covariance Qinv, and Y | X is Gaussian with mean X and variance varY * I.  Note Qinv is tri-diagonal and can be formed with a single call to “spdiags”.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s