I have a stationary (constant mean, constant standard deviation) time series $y_t$, that contains some missing values and some incorrect values (values so far from the distribution they are obviously wrong).
I have a simple method to detect these incorrect values which works well. However, I would like to know if there are any standard or canonical ways of imputing these missing and wrong values that does not have look ahead bias i.e if we are at some point $t$ in the series, we can only use data and information from points at $k\leq t$.
What I have tried so far is simply to impute the wrong value with the median of the previous $n$ values. But I’m looking for a method that perhaps uses more descriptive statistics of the distribution of the time series.