**Dilemma
**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.

**Data
**Daily closing prices for all 355 stocks listed on Stockholm OMX, from October 2012 to September 2017, were analyzed.***

**Result
**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.

**Conclusion
**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.

**Appendix
**Brown et al. demonstrate that:

The operators are given by:

S_{t}^{(n)}(x) = *αS _{t}*

^{(n-1}

^{)}(x) + (1 –

*α*)

*S*

_{t}^{(n-1}

^{)}(x),

where *α *is a discount factor (decided by the forecaster) and

*S _{t}*

^{(0}

^{)}= x

*.*

_{t}We will use a linear trend model to forecast one-day-ahead-of-day-*t* stock prices. Such a model has the following form:

x* _{t+1}* =

*a*+

_{t}*b*,

_{t}where

*a _{t} = *2 * S

_{t}^{(1)}(x) – S

_{t}^{(2)},

*S*

_{bt}= α / (1 – α) * (

_{t}^{(1)}(x) – S

_{t}^{(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:

S_{0}^{(1)} = S_{0}^{(2)} = x* _{0}*.

*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.