The paper derives an algorithm for computing leave-k-out diagnostics for the detection of patches of outliers for stationary and non-stationary state space models with regression effects. The algorithm is based on a reverse run of the Kalman filter on the smoothing errors and is both efficient...