This note describes how the Kalman filter can be modified to allow for the
vector of observables to be a function of lagged variables without increasing the dimension
of the state vector in the filter. This is useful in applications where it is desirable to keep
the dimension of the state vector low. The modified filter and accompanying code (which
nests the standard filter) can be used to compute (i) the steady state Kalman filter (ii) the
log likelihood of a parameterized state space model conditional on a history of observables
(iii) a smoothed estimate of latent state variables and (iv) a draw from the distribution of
latent states conditional on a history of observables.