Smoothing Techniques (Con’t)
Regression on seasonality and trend
| Linear Regression | VS | Trend Component |
| Multi-Linear Regression | VS / to handle | Seasonality Component |
Using dummy encoding to handle season. 3 dummy to handle quarterly, 11 dummy to handle monthly.

Excel
1. Raw Data; Predict Year 6.
| Season | Year 1 | Year 2 | Year 3 | Year 4 | Year 5 |
|---|---|---|---|---|---|
| Fall | 3497 | 3726 | 3989 | 4248 | 4443 |
| Winter | 3484 | 3589 | 3870 | 4105 | 4307 |
| Spring | 3552 | 3742 | 3996 | 4263 | 4466 |
| Summer | 3837 | 4050 | 4327 | 4544 | 4795 |

2. Transform into tall format.
3. Create row number and name it as “Slope”.
4. Create Dummy Encoding to all the season.
5. Check if Excel solver is enable.


6. Open Regression dialog.
7. Setup accordingly.


8. Excel produce regression result, but we only interested to highlighted red.
9. Fill-up earlier formula.


10. Make prediction.
11. Result.

R
seasonaldummy(data) → create dummy encoding
imported_sales_dummy <- seasonaldummy(imported_sales)
Result:

Next, create row number
imported_sales_time <- 1:length(imported_sales)
tslm(data) → create [T]ime [S]eries [L]inear [M]odel
imported_sales_reg <- tslm(imported_sales~imported_sales_time+imported_sales_dummy)
Result:

Plot chart
plot(imported_sales, ylab='Sales')
lines(imported_sales_reg$fitted.values, col=2, lwd=2)
legend("topleft",
c("Actual","Linear Reg."),
col=1:2,
lwd=2,
cex=1)

Winter’s Exponential Smoothing
Extension of Holts Method, by introducing beta parameter.
- alpha = level smoothing constant
- beta = trend smoothing constant
- gamma = seasonality smoothing constant
ps. this has additive and multiplicative hyperparameter as well.
Excel
1. Raw Data; Predict Year 4 with condition of:
alpha = 0.1
beta = 0.3
gamma = 0.4


2. Calculate initial year level smoothing.
3. Calculate initial year trend smoothing.


4. Calculate initial year seasonal smoothing.
5. You should achieve following result.


6. Continue on subsequent years for level smoothing.
7. Continue on subsequent years for trend smoothing.


8. Continue on subsequent years for seasonal smoothing.
9. You should achieve following result.


10. Creating the forecast column.
11. You should achieve following result.


12. Make prediction.
13. Result.


Leave a comment