Moving Horizon Estimation With Dynamic Programming