Forecast the Data for 2000 Again in Problem 1 With Exponential Smoothing
Elementary exponential smoothing
The simplest of the exponentially smoothing methods is naturally called simple exponential smoothing (SES)13. This method is suitable for forecasting data with no articulate tendency or seasonal pattern. For example, the data in Effigy 7.1 do not display whatever clear trending behaviour or any seasonality. (There is a rise in the final few years, which might suggest a trend. We will consider whether a trended method would be better for this serial afterward in this affiliate.) We have already considered the naïve and the average equally possible methods for forecasting such data (Section iii.1).
oildata <- window(oil, first= 1996) autoplot(oildata) + ylab("Oil (millions of tonnes)") + xlab("Year")
Figure 7.1: Oil product in Saudi arabia from 1996 to 2013.
Using the naïve method, all forecasts for the time to come are equal to the concluding observed value of the series, \[ \hat{y}_{T+h|T} = y_{T}, \] for \(h=ane,2,\dots\). Hence, the naïve method assumes that the most recent observation is the simply important one, and all previous observations provide no information for the future. This can be thought of as a weighted boilerplate where all of the weight is given to the last observation.
Using the average method, all future forecasts are equal to a uncomplicated boilerplate of the observed data, \[ \hat{y}_{T+h|T} = \frac1T \sum_{t=1}^T y_t, \] for \(h=1,2,\dots\). Hence, the average method assumes that all observations are of equal importance, and gives them equal weights when generating forecasts.
We often desire something between these two extremes. For example, it may be sensible to attach larger weights to more than recent observations than to observations from the distant by. This is exactly the concept backside uncomplicated exponential smoothing. Forecasts are calculated using weighted averages, where the weights decrease exponentially as observations come up from further in the by — the smallest weights are associated with the oldest observations: \[\begin{equation} \chapeau{y}_{T+1|T} = \alpha y_T + \alpha(i-\alpha) y_{T-i} + \alpha(1-\alpha)^2 y_{T-ii}+ \cdots, \tag{7.1} \terminate{equation}\] where \(0 \le \alpha \le 1\) is the smoothing parameter. The one-stride-ahead forecast for time \(T+i\) is a weighted average of all of the observations in the series \(y_1,\dots,y_T\). The rate at which the weights decrease is controlled by the parameter \(\alpha\).
The table below shows the weights attached to observations for four unlike values of \(\alpha\) when forecasting using simple exponential smoothing. Note that the sum of the weights even for a small-scale value of \(\alpha\) will exist approximately one for any reasonable sample size.
| \(\alpha=0.two\) | \(\blastoff=0.4\) | \(\alpha=0.6\) | \(\alpha=0.eight\) | |
|---|---|---|---|---|
| \(y_{T}\) | 0.2000 | 0.4000 | 0.6000 | 0.8000 |
| \(y_{T-1}\) | 0.1600 | 0.2400 | 0.2400 | 0.1600 |
| \(y_{T-2}\) | 0.1280 | 0.1440 | 0.0960 | 0.0320 |
| \(y_{T-3}\) | 0.1024 | 0.0864 | 0.0384 | 0.0064 |
| \(y_{T-4}\) | 0.0819 | 0.0518 | 0.0154 | 0.0013 |
| \(y_{T-5}\) | 0.0655 | 0.0311 | 0.0061 | 0.0003 |
For whatsoever \(\blastoff\) between 0 and ane, the weights attached to the observations decrease exponentially as we go back in time, hence the name "exponential smoothing". If \(\blastoff\) is small (i.e., close to 0), more than weight is given to observations from the more afar past. If \(\alpha\) is large (i.e., close to 1), more than weight is given to the more than recent observations. For the farthermost case where \(\alpha=1\), \(\hat{y}_{T+1|T}=y_T\), and the forecasts are equal to the naïve forecasts.
We nowadays ii equivalent forms of simple exponential smoothing, each of which leads to the forecast Equation (7.1).
Weighted boilerplate class
The forecast at fourth dimension \(T+one\) is equal to a weighted average between the most recent observation \(y_T\) and the previous forecast \(\hat{y}_{T|T-1}\): \[ \hat{y}_{T+1|t} = \alpha y_T + (one-\blastoff) \hat{y}_{T|T-1}, \] where \(0 \le \alpha \le 1\) is the smoothing parameter. Similarly, we can write the fitted values as \[ \hat{y}_{t+1|t} = \alpha y_t + (1-\alpha) \chapeau{y}_{t|t-i}, \] for \(t=one,\dots,T\). (Call back that fitted values are merely 1-step forecasts of the training data.)
The process has to commencement somewhere, and then nosotros allow the first fitted value at fourth dimension one exist denoted by \(\ell_0\) (which we will have to estimate). Then \[\begin{marshal*} \hat{y}_{2|1} &= \alpha y_1 + (i-\alpha) \ell_0\\ \hat{y}_{3|ii} &= \alpha y_2 + (1-\alpha) \hat{y}_{ii|ane}\\ \hat{y}_{4|3} &= \alpha y_3 + (1-\alpha) \chapeau{y}_{3|2}\\ \vdots\\ \lid{y}_{T|T-one} &= \alpha y_{T-one} + (i-\alpha) \hat{y}_{T-1|T-ii}\\ \chapeau{y}_{T+1|T} &= \blastoff y_T + (one-\alpha) \hat{y}_{T|T-i}. \cease{align*}\] Substituting each equation into the post-obit equation, we obtain \[\brainstorm{marshal*} \hat{y}_{3|ii} & = \alpha y_2 + (one-\alpha) \left[\alpha y_1 + (1-\alpha) \ell_0\right] \\ & = \alpha y_2 + \alpha(ane-\alpha) y_1 + (i-\alpha)^ii \ell_0 \\ \hat{y}_{4|3} & = \blastoff y_3 + (i-\blastoff) [\alpha y_2 + \alpha(1-\alpha) y_1 + (i-\alpha)^2 \ell_0]\\ & = \alpha y_3 + \blastoff(1-\alpha) y_2 + \blastoff(1-\alpha)^ii y_1 + (ane-\blastoff)^3 \ell_0 \\ & ~~\vdots \\ \hat{y}_{T+1|T} & = \sum_{j=0}^{T-i} \alpha(1-\alpha)^j y_{T-j} + (ane-\blastoff)^T \ell_{0}. \end{align*}\] The concluding term becomes tiny for big \(T\). And then, the weighted average form leads to the same forecast Equation (vii.one).
Component form
An culling representation is the component class. For uncomplicated exponential smoothing, the only component included is the level, \(\ell_t\). (Other methods which are considered later on in this chapter may also include a trend \(b_t\) and a seasonal component \(s_t\).) Component grade representations of exponential smoothing methods comprise a forecast equation and a smoothing equation for each of the components included in the method. The component form of simple exponential smoothing is given past: \[\begin{align*} \text{Forecast equation} && \chapeau{y}_{t+h|t} & = \ell_{t}\\ \text{Smoothing equation} && \ell_{t} & = \blastoff y_{t} + (1 - \alpha)\ell_{t-one}, \end{align*}\] where \(\ell_{t}\) is the level (or the smoothed value) of the series at time \(t\). Setting \(h=i\) gives the fitted values, while setting \(t=T\) gives the true forecasts across the grooming information.
The forecast equation shows that the forecast value at fourth dimension \(t+1\) is the estimated level at time \(t\). The smoothing equation for the level (usually referred to every bit the level equation) gives the estimated level of the series at each menstruum \(t\).
If nosotros supplant \(\ell_t\) with \(\chapeau{y}_{t+ane|t}\) and \(\ell_{t-1}\) with \(\hat{y}_{t|t-1}\) in the smoothing equation, we will recover the weighted boilerplate form of simple exponential smoothing.
The component class of elementary exponential smoothing is not particularly useful, but it volition be the easiest grade to apply when we start adding other components.
Flat forecasts
Simple exponential smoothing has a "flat" forecast role: \[ \hat{y}_{T+h|T} = \hat{y}_{T+1|T}=\ell_T, \qquad h=ii,3,\dots. \] That is, all forecasts accept the same value, equal to the last level component. Retrieve that these forecasts will only be suitable if the time series has no trend or seasonal component.
Optimisation
The awarding of every exponential smoothing method requires the smoothing parameters and the initial values to be called. In particular, for simple exponential smoothing, nosotros need to select the values of \(\alpha\) and \(\ell_0\). All forecasts can be computed from the data once we know those values. For the methods that follow in that location is usually more than one smoothing parameter and more than than 1 initial component to exist chosen.
In some cases, the smoothing parameters may exist chosen in a subjective fashion — the forecaster specifies the value of the smoothing parameters based on previous experience. Notwithstanding, a more reliable and objective fashion to obtain values for the unknown parameters is to approximate them from the observed data.
In Department 5.two, nosotros estimated the coefficients of a regression model by minimising the sum of the squared residuals (ordinarily known as SSE or "sum of squared errors"). Similarly, the unknown parameters and the initial values for whatsoever exponential smoothing method tin exist estimated past minimising the SSE. The residuals are specified as \(e_t=y_t - \chapeau{y}_{t|t-1}\) for \(t=1,\dots,T\). Hence, we find the values of the unknown parameters and the initial values that minimise \[\begin{equation} \text{SSE}=\sum_{t=ane}^T(y_t - \hat{y}_{t|t-1})^2=\sum_{t=i}^Te_t^ii. \tag{7.ii} \stop{equation}\]
Unlike the regression example (where we have formulas which render the values of the regression coefficients that minimise the SSE), this involves a non-linear minimisation problem, and we need to employ an optimisation tool to solve it.
Case: Oil production
In this example, simple exponential smoothing is practical to forecast oil production in Saudi arabia.
oildata <- window(oil, first= 1996) # Estimate parameters fc <- ses(oildata, h= 5) # Accuracy of one-stride-ahead preparation errors circular(accuracy(fc),2) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 6.iv 28.12 22.26 one.one 4.61 0.93 -0.03 This gives parameter estimates \(\hat\alpha=0.83\) and \(\lid\ell_0=446.6\), obtained by minimising SSE over periods \(t=i,2,\dots,18\), subject to the restriction that \(0\le\alpha\le1\).
In Table vii.1 we demonstrate the calculation using these parameters. The 2d concluding column shows the estimated level for times \(t=0\) to \(t=18\); the final few rows of the last column prove the forecasts for \(h=i,2,three,4,5\).
| Year | Fourth dimension | Observation | Level | Forecast |
|---|---|---|---|---|
| \(t\) | \(y_t\) | \(\ell_t\) | \(\hat{y}_{t\vert t-1}\) | |
| 1995 | 0 | 446.59 | ||
| 1996 | 1 | 445.36 | 445.57 | 446.59 |
| 1997 | 2 | 453.20 | 451.93 | 445.57 |
| 1998 | 3 | 454.41 | 454.00 | 451.93 |
| 1999 | 4 | 422.38 | 427.63 | 454.00 |
| 2000 | 5 | 456.04 | 451.32 | 427.63 |
| 2001 | 6 | 440.39 | 442.xx | 451.32 |
| 2002 | 7 | 425.xix | 428.02 | 442.twenty |
| 2003 | 8 | 486.21 | 476.54 | 428.02 |
| 2004 | 9 | 500.43 | 496.46 | 476.54 |
| 2005 | 10 | 521.28 | 517.15 | 496.46 |
| 2006 | 11 | 508.95 | 510.31 | 517.15 |
| 2007 | 12 | 488.89 | 492.45 | 510.31 |
| 2008 | thirteen | 509.87 | 506.98 | 492.45 |
| 2009 | 14 | 456.72 | 465.07 | 506.98 |
| 2010 | 15 | 473.82 | 472.36 | 465.07 |
| 2011 | xvi | 525.95 | 517.05 | 472.36 |
| 2012 | 17 | 549.83 | 544.39 | 517.05 |
| 2013 | xviii | 542.34 | 542.68 | 544.39 |
| \(h\) | \(\hat{y}_{T+h\vert T}\) | |||
| 2014 | 1 | 542.68 | ||
| 2015 | 2 | 542.68 | ||
| 2016 | 3 | 542.68 | ||
| 2017 | four | 542.68 | ||
| 2018 | v | 542.68 |
The black line in Effigy seven.2 is a plot of the data, which shows a changing level over time.
autoplot(fc) + autolayer(fitted(fc), series= "Fitted") + ylab("Oil (millions of tonnes)") + xlab("Year")
Figure 7.two: Unproblematic exponential smoothing practical to oil product in Saudi Arabia (1996–2013).
The forecasts for the period 2014–2018 are plotted in Figure 7.ii. Also plotted are 1-footstep-alee fitted values alongside the information over the menses 1996–2013. The large value of \(\alpha\) in this example is reflected in the big adjustment that takes place in the estimated level \(\ell_t\) at each time. A smaller value of \(\blastoff\) would lead to smaller changes over time, so the series of fitted values would be smoother.
The prediction intervals shown here are calculated using the methods described in Department 7.7. The prediction intervals evidence that there is considerable uncertainty in the future values of oil production over the five-year forecast period. Then interpreting the point forecasts without accounting for the large uncertainty can exist very misleading.
Source: https://otexts.com/fpp2/ses.html
0 Response to "Forecast the Data for 2000 Again in Problem 1 With Exponential Smoothing"
Post a Comment