2
$\begingroup$

I'm learning some time series analysis and forecasting techniques, I've tried to predict stock prices for Netflix but I'm very confused.

At first I've tried Auto ARIMA which gave me a straight line, obviously it's a bad fit, then I tried a linear regression between X(t) and it's lagged version, I've plotted a lag plot and saw that there is a very strong correlation between X(t) up to X(t-10) so I trained a linear regression model using X(t-1)...X(t-6) as features (predictors) and X(t) as a target.

I've compared the predictions next to the test set and the results were quite shocking, the model was nearly perfect and predictions were almost equal to actual values in the data set.

The MAE is only 6.25 (6.25 dollars off in average).

Next I tried another ML technique which is the Gradient Boosting Trees algorithm and results were as perfect as the linear regression model, you can see the results here

enter image description here

So I was thinking that something was wrong and I tried changing my variable, this time instead of using closing prices I used returns (using both algorithms) and the results were very bad and very off as you can see here:

enter image description here

and this is when I multiply predictions by 10:

enter image description here

These results are very confusing for me, I'm wondering why am I fitting the closing prices almost perfectly while returns are modeled quite badly ? and most importantly What's the recommended approach to predict stock prices ?

Note: I already know that returns are stationary while closing prices tend to not be, but is this important ? and If so why ?

Thank you !

$\endgroup$
3
$\begingroup$

The previous day price is an excellent predictor of the next day price, however the previous day return doesn't tell you much about the next day return.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Lilane is absolutely correct but another way of saying it is that prices move very slowly and returns move very quickly. So, if your algorithm is working off prices, it's not going to work when you increase the horizon $\endgroup$ – mark leeds Apr 20 at 3:05
1
$\begingroup$

A stock price in theory is a random walk: the expected value of today’s price is yesterday’s price. So from looking at a chart, yes a regression of $S_t$ on $S_{t-1}$ will appear very close in terms of fit. That’s because the price today is that of yesterday plus or minus a random element centered around zero.

That’s not to say that regression is useful as a trading tool. Your regression error will basically be your daily change in price which is the actual quantity of interest in terms of trading. So you haven’t extracted information that is going to be of use for the task at hand.

Of course in reality some prices some of the time will not be true random walks and those are times when a simple day-on-day price regression may help in your trading. This should be exceedingly rare and fleeting though.

| improve this answer | |
$\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.