0
$\begingroup$

I am currently trying to predict the close price of the TSLA stock for March 2022 using LSTM model. Initially, I was using TSLA stock data starting from 2012 to of course March 2022. However, I was wondering if this is effective as the TSLA stock has undergone great changes in terms of its volatility, behavior, and momentum over the years. Below you can see the stock's price history starting almost 2014. After 2020 its behavior and momentum change drastically. Is there any way to extract only those last n months' data that can help predict future prices with higher accuracy? enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

The LSTM layer expects input of shape (batch_size, n_timesteps, n_features), you could adjust n_timesteps so that each sample uses only last n-month's data.

Also as you already noticed, the prices have undergone dramatic changes over time, this affects the modeling: your target is not stationary, and your features are probably also not stationary. (Given your context, I'm assuming you are using prices to predict prices.) You'll be much better off by predicting price returns and making some features that are stable over time.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.