jinglescode / time-series-forecasting-pytorch

Acquiring data from Alpha Vantage and predicting stock prices with PyTorch's LSTM
https://www.alphavantage.co/academy/#lstm-for-finance
Apache License 2.0
251 stars 95 forks source link

Lookahead Bias #19

Open ukuarep opened 1 year ago

ukuarep commented 1 year ago

The Normalizer class computes the mean and standard deviation over the full data set.

Doesn't this introduce lookahead bias in the model essentially feeding information about future stock prices into you past price data?

cjpaine109 commented 3 months ago

This is correct ^^. Also, in the preprocessing steps, shuffling the data -> dataloader arg leads to lookahead bias...