I’m trying to forecast future trends basing of future data. I’ve go through some tutorials like here:
- jinglescode/time-series-forecasting-pytorch: Acquiring data from Alpha Vantage and predicting stock prices with PyTorch’s LSTM (github.com)
- Time Series Forecasting using Pytorch - GeeksforGeeks
And I was able to reproduce it on my data. But both approaches provides the same concept:
- ANN gets values for days in the range from x to x+w (where w is a lookback window, usually 20 - 50 points).
- ANN returns predictions for days x+1 to x+w+1 (so overlapping with input)
- Dropping all days except the last - this is the result
So basically, it always models only one day in the future. You can use it in a loop, by adding the newest value to the end of input but as both train and test dataset is evaluated versus only one-day shift, the future predictions are usually poor, with a lot of oscillation. Also, because 90% of the modeled data overlaps with the input, it mask the error on the last day. So even if the “new” day is poorly modeled, the other overlapping days will hide it because the error is mean value. Is it the only way, or can I do it better? If so can you provide me with som MWE or tutorials how to it?