I am using aryule to construct a predictive AR filter. After I filter the data, the predicted values "lead" the actual data by one step. To illustrate this, I placed two images . The first shows the total actual and predicted data together (blue is actual, and orange is predicted. The second shows a zoomed in portion, so that the lead is apparent.
I don't understand where this lead comes from, nor do I know how to get rid of it in a justifiable way. Should I just shift the predicted data ahead by one step? Is this a relic of the filtering process? The code I'm using to get here is:
h = aryule(signal,26);
est_signal = filter(-h(2:end),1,signal);