Delay issue in time series prediction I am having an issue using neural networks to predict time series. Some predicted data fits with the expected data, as bellow: (In black the real time series and in blue the output of my neural network)


Time serie: Australia energy demand.

But with the same code, with other time series, the predicted data does not fits with the expected data, and has a delay of one unit, as bellow:


Time serie: Walmart Stock price.

Time serie: Dollar libra exchange.

I found some articles about some variations of neural networks and at the results section shows the plot with the delay like my results, as bellow:


Time serie: Dollar libra exchange. 
(Article link: http://www.sciencedirect.com/science/article/pii/S1877050915015793)

Anyone knows if this is a common behavior or can be something wrong with my code ? I am having this issue about three months ago, and since there I am trying to figure out some bug in my code but is all right.

Thanks and I appreciate any tip.
The error may be in calling the actual time series "expected data" (unless you expect an unpredictable random walk).

If each sample is random and uncorrelated with all previous time series measurements, except for having a distribution mean near that of the immediately preceding sample (such as in a random walk), than any predictor (NN or other) of the next sample might lag (guess near the mean of the distribution, e.g. just the previous sample).

In the cases where the mechanics of some hidden state (planetary rotational or orbital momentum, etc.) is producing the measured data, a NN might be able to be trained to deduce certain hidden oscillators (low order diffEQ solutions involving that state) or some trend line, and thus not lag.

So, the lag you find may be a measurement of how well your NN is differentiating between the two cases above.

If you don't want to see a lag, then try increasing the training error function for producing a lagged output until the NN is trained to produce a different (more random?) output than a mere input follower, given a random walk input.