1 HW3: Time Series Decomposition

Please submit exercises 6.2 and 6.3 in the Hyndman book. Please submit your Rpubs link as well as your .rmd file with your code.

1.1 Ex. 6.2

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

(a.) Plot the time series of sales of product A. Can you identify seasonal fluctuations and/or a trend-cycle?

(b.) Use a classical multiplicative decomposition to calculate the trend-cycle and seasonal indices.

(c.) Do the results support the graphical interpretation from part a?

(d.) Compute and plot the seasonally adjusted data.

(e.) Change one observation to be an outlier (e.g., add 500 to one observation), and recompute the seasonally adjusted data. What is the effect of the outlier?

(f.) Does it make any difference if the outlier is near the end rather than in the middle of the time series?

1.1.1 Part a

Plot the time series of sales of product A. Can you identify seasonal fluctuations and/or a trend-cycle?

Answer:

  • Dataset plastics: Monthly sales of product A for a plastics manufacturer

  • The plots below shows a high seasonality effects in the time series of sales of product A. Most of the sales peaks are around summer. There is also an increasing trend over the years in this time series.

1.1.3 Part c

Do the results support the graphical interpretation from part a?

Answer:

  • Yes, the results in part b support the graphical interpretation from part a.

  • From the classical multiplicative decomposition graphs, the trend graph does shows an increasing trend over the years. The seasonal graph also shows an obvious seasonality with peaks at around summer of each year.

1.1.5 Part e

Change one observation to be an outlier (e.g., add 500 to one observation), and recompute the seasonally adjusted data. What is the effect of the outlier?

Answer:

  • The outlier at the middle of the time series affects more on the trend than the seasonality of this time series. The trend has a small peak and low at around the 4th year due to the existence of the outlier. The period of the seasonality does not change, but its shape has changed slightly.

1.1.6 Part f

Does it make any difference if the outlier is near the end rather than in the middle of the time series?

Answer:

  • The outlier near the end of the time series has a higher effect on the trend, and a smaller effect on the seasonality of this time series, which has similar effect as part e. The trend increased at near the end of the time series due to the existence of the outlier, and the shape of the seasonality has slightly changed.

  • No matter where the outlier is being placed, we can see that the trend has changed in the decomposition trend graph and the shape of the seasonality has also changed slightly.

  • Therefore, outlier would affect the time series no matter where it is being placed.

1.2 Ex. 6.3

Recall your retail time series data (from Exercise 3 in Section 2.10).

Decompose the series using X11. Does it reveal any outliers, or unusual features that you had not noticed previously?

1.2.1 retail

Answer:

  • From the X11 decomposition remainder graph, we can see that there are multiple up or down spikes, which can be considered outliers and the largest up spike locates at near year 2000. However, we do not see any obvious effects or irregular pattern in the original graph.

  • Different from Question 6.2, the seasonal graph from X11 decomposition below varies over time instead of being the same shape over the whole time series.

  • X11 decomposition can overcome the drawbacks of classical decomposition, which is, the trend and seasonality would be affected by outliers. In X11 decomposition, the seasonal component is allowed to vary slowly over time. Therefore, X11 decomposition performs better than the classical decomposition method.