Exercise 6.2

The plastics data set consists of the monthly sales (in thousands) of product A for a plastics manufacturer for five years.

The dataset is small enough that we can start by visually inspecting the data.

plastics
##    Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
## 1  742  697  776  898 1030 1107 1165 1216 1208 1131  971  783
## 2  741  700  774  932 1099 1223 1290 1349 1341 1296 1066  901
## 3  896  793  885 1055 1204 1326 1303 1436 1473 1453 1170 1023
## 4  951  861  938 1109 1274 1422 1486 1555 1604 1600 1403 1209
## 5 1030 1032 1126 1285 1468 1637 1611 1608 1528 1420 1119 1013
a) Plot the time series of sales of product A. Can you identify seasonal fluctuations and/or a trend-cycle?
autoplot(plastics)

Answer:

It looks like there is a bit of a positive trend and seasonal fluctuations are present.

b) Use a classical multiplicative decomposition to calculate the trend-cycle and seasonal indices.
decplas <- plastics %>% decompose(type="multiplicative") 

autoplot(decplas) + xlab("Year") +
  ggtitle("Classical multiplicative decomposition of plastics")