Time Series Decomposition

Exercise 6.2

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

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

The curve is trending upwards, with a seasonal frequency of 1 year. Refer ggseasonplot in earlier chapters.

Sales starts trending up from Feb-Mar, attains a maxima from Jul-Oct, then keeps falling up to December.

  1. Use a classical multiplicative decomposition to calculate the trend-cycle and seasonal indices.

Although sales in all four graphs trend upwards, there is seasonality within a year.

  1. Do the results support the graphical interpretation from part a?

Results of Classical Decomposition are consistent with observations from part a – upward trend, with a seasonal component.

  1. Compute and plot the seasonally adjusted data.

Upward trending, after seasonally adjusted.

  1. 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?

I broke the task into three code chunks for better readability

As opposed to earlier code chunk (d), I am storing outlier %>% decompose(type = “multiplicative”) in a variable fit, because I’ll use it twice.

## Warning: Removed 12 row(s) containing missing values (geom_path).

I created two outliers in the 7th and 19th indices i.e. on the July of two consecutive years. So, the curve spiked up at those two points, everything remains the same – trends upwards and still sesonal.

The below autoplot() vindicates the same observation.

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

I broke the task into two code chunks for better readability

Based on my graph, there is bigger effect in the end than in the middle. I am not sure why it’s spiking up in the end.

So, I tested the effects on different parts of the graph, in a separate RMD and observed their effects. The outlier-effects are not only higher towards the end, but also at the begining.

Exercise 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?

Seasonallity with frequency of 1 year. Remainder has two major spikes, plus a few here and there, which probably indicate outliers.

Marker: 624-03