I was reading about exponential smoothing on Wikipedia. I saw a sentence saying that I could find the optimal parameter $alpha$ by using the method of least squares. How do I go about doing that? Are there other ways I can find the right $alpha$?

**Edit:** Also, if possible, I'd like a way to handle missing values.

**Contents**hide

#### Best Answer

Minimize the sum of squared one-step forecast errors. If $hat{Y}_t$ is the prediction of $Y_t$ given $Y_1,dots,Y_{t-1}$, then $e_t=Y_t-hat{Y}_t$ is the one-step forecast error. So minimize $e_2^2+cdots+e_n^2$.

You can also use maximum likelihood estimation as discussed in my Springer book.

If you're just using simple exponential smoothing, and are happy to assume normal errors with constant variance, then an ARIMA(0,1,1) model is equivalent.

When you use a state space representation (such as in the innovations state space form, or by writing the ARIMA model in state space form), then handling missing values is easy. For example, the R function `arima()`

will handle missing values without complaint.