DATA 624—Homework No. 3

Ben Horvath

February 23, 2020

Problem No. 6.2

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

There is both seasonality and trend. The time series increases over time. For every year, the lowest point is January, and the highest point is in the summer.

Note: The seas() function gives me error about the start date being too small, so I am forcing an arbitrary start date of 1998.

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

The data has been decomposed into three components: seasonality, trend, and randomness.

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

Yes.

  1. Compute and plot the seasonally adjusted data.

This plots the seasonally adjusted data, i.e., the time series minus seasonality, but retaining the trend and random variation.

  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?

In the presence of a massive outlier, the seasonally adjusted series remains almost exactly the same, except for the one month with the outlier. That is, an outlier does not throw off the entire calculation.

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

It appears it does matter whether the outlier is at the end rather than the middle of the time series.

Below, I added 500 to the second-to-last observation. We see that the seasonally adjusted fit varies quite a bit. Much more than when the outlier was in the middle.

Problem No. 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?

Load the data and select a particular time series to decompose:

This plot certainly reveals extra details. Broadly, it is easier to see the changing rates of growth, which probably correspond to changes in the economy:

  1. Growth in the first ten years, increased variance in the early 1990s corresponding to recession

  2. Growth up through the late 1990s, when growth picked up

  3. Large variance in early 2000s (911, Bush recession)

  4. Growth through the mid-2000s, a slowdown, then increased growth up to 2008

  5. Largest variances in about 2008 (Great Recession)

  6. Flat (long, slow recovery)