It’s obviously of interest to be able to predict future stock prices. In this post and a series of posts I will look at different forecasting methods and compare their performances using the one-step-ahead forecast error*.
Method: Brown’s double exponential smoothing
Brown et al.’s** method for forecasting stock prices is described in the appendix. What is important to know is that the method requires a discount factor which must be decided by forecaster. This factor is the emphasizes that is put on the most recent stock price, relative to previous prices, when the future price is predicted. We will try different factors to see which one minimizes the forecast error.
Daily closing prices for all 355 stocks listed on Stockholm OMX, from October 2012 to September 2017, were analyzed.***
Figure 1 shows the mean absolute percentage error (MAPE)**** for different discount factors. It turns out that the error is minimized given a discount factor of 0.4. Then the forecast differs from the actual value by about 2.0 percent each day.
Before we can decide if a 2.0 percent deviation is good or bad we must have another method to compare this performance with. We will look at another method in an upcoming post.
Brown et al. demonstrate that:
The operators are given by:
St(n)(x) = αSt(n-1)(x) + (1 – α) St(n-1) (x),
where α is a discount factor (decided by the forecaster) and
St(0) = xt.
We will use a linear trend model to forecast one-day-ahead-of-day-t stock prices. Such a model has the following form:
xt+1 = at + bt,
at = 2 * St(1)(x) – St(2),
bt = α / (1 – α) * (St(1)(x) – St(2)),
as shown in the article. The smoothing operators require recursive computations and we will use the first value in the time series as initial value:
S0(1) = S0(2) = x0.
*This is the difference between the stock price and the forecast that was made one day before.
**Brown, Robert G., et al. “The Fundamental Theorem of Exponential Smoothing.” Operations Research, vol. 9, no. 5, 1961, pp. 673–687.
***To collect the data I used Web Scraping with Python.
****This is the absolute value of the forecast error divided by the actual price, i.e. the relative forecast error without regard to its sign.