lag in prediction outputs in one-step ahead neural network autoregressive model

I am working on an ARX forecasting problem mostly using feed-forward neural networks in MATLAB. The functional model is of the form $y(t) = f(y(t-1),...,y(t-n),u(t))$. My data is at half hourly resolution.

The problem is that forecasted outputs appear to be lagged by one time step when compared to the true outputs.

I have successfully applied my forecasting model to a similar data set. A new set I am testing has a lot more variation sample-to-sample. That is, the trained model gives a prediction $\hat{y}(t)$ that is very close to $y(t-1)$. When I consider predictions farther into the future, such as $y(t) = f(y(t-j),...,y(t-n-j),u(t))$, where $j>4$ and the short-term autoregressive contribution is weaker (which is also observed in the trained model), I don't observe this offset.

To sanity check, I have trained a simple AR(n) model using OLS, and I observe the same sorts of lags on my data. When I use the same procedure on my earlier, and smoother, data set, no such lag exists. I have also generated a model $y(t) = \sin(t) + w(t)$, where $w(t) \sim N(0,\sigma^2)$, sampled at .1 s, and attempted to train a model using both neural networks and OLS. The inputs are $y(t-1),\ldots,y(t-4)$, and the targets are $y(t)$. For both, when $\sigma$ is sufficiently small (say $<0.5$, the predicted values for newly generated outputs doesn't exhibit a lag, but as the variance increases (say $>.1$), I notice the one-step lag.

Could you please let me know what's going on? I'm hoping this is just a beginner's mistake... but I'm quite puzzled as I have tried a number of other modeling approaches and observed similar behavior. Thanks in advance!

• I want to ask you, if you have solve this Problem for yourself? (Sorry for writing it as an answer, but I didn't find an other way to contact you) I have the same Problem with simple MLP (but it also occurs with NARX). I have a lag between the targets to Train and the simulated network output. The lag is equal to my forecast period, no matter how big it is. It is independend of data resolution and input selection. But with regular data like sine function or rectangular function, the effect didn't occur. So if you have found a solution or have some tipps to check, please let me know. best regar Dec 3 '14 at 8:38
• This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. Dec 3 '14 at 9:58
• This sounds like a off-by-one error in your code. Can you give us something reproducible to work with? Oct 9 '16 at 23:46

1 Answer

Most likely, there is nothing wrong with your code or your data. What is happening is that your neural network is starting to act like a so-called "naive predictor" (look it up), meaning that since the NN cannot resolve the problem (cannot resolve any pattern in the input data), the best answer is the previous value. There are a number of techniques to try to solve this (using deltas, etc.) but I have yet to see one work (which does not mean it won't work; just that I haven't seen pre-processing the input data solve the problem). Just my 2 cents...