The stochastic distance function model is extended to allow for the inefficiency component of the error term to be autocorrelated, as implied by a dynamic model of firm behavior. The autocorrelation parameter can then be interpreted as a measure of the persistence of inefficiency. The model is viewed from a state-space perspective, and Kalman filtering techniques are proposed for estimation. The model is applied to two panels of dairy farms from Germany and the Netherlands. The results suggest a very high degree of persistence of inefficiency through time.