Exercise

Box-Cox transformations for time series

Here, you will use a Box-Cox transformation to stabilize the variance of the pre-loaded a10 series, which contains monthly anti-diabetic drug sales in Australia from 1991-2008.

In this exercise, you will need to experiment to see the effect of the lambda (\(\lambda\)) argument on the transformation. Notice that small changes in \(\lambda\) make little difference to the resulting series. You want to find a value of \(\lambda\) that makes the seasonal fluctuations of roughly the same size across the series.

Recall from the video that the recommended range for lambda values is \(-1 ≤ \lambda ≤ 1\).

Instructions

100 XP
  • Plot the a10 series and observe the increasing variance as the level of the series increases.
  • Try transforming the series using BoxCox() in the format of the sample code. Experiment with four values of lambda: 0.0, 0.1, 0.2, and 0.3. Can you determine which lambda value approximately stabilizes the variance?
  • Now compare your chosen value of lambda with the one returned by BoxCox.lambda().