BoxCox TransformationΒΆ
Many time series models require stationary data. However, realworld time series data may be nonstationary and heteroscedastic^{1}. Boxcox transformation is useful when reducing the nonstationarity and heteroscedasticity.
Rob J Hyndman and George Athanasopoulos's famous textbook FPP2 provides some nice examples of boxcox transformations.
To see BoxCox transformation in action, we show an example using the air passenger dataset.
The air passenger dataset is a monthly dataset. We can observe the trend and varying variance simply by eyes.
Applying BoxCox transformations with different lambdas leads to different results shown below.
To check the variance, we plot out the variance rolling on a 12month window.
BoxCox transformation with \(\lambda =0.1\) reduces the variability in variance.
BoxCox May not Always Reach Perfect Stationary Data
BoxCox transformation is a simple transformation that helps us reduce the nonstationarity and heteroscedasticy. However, we may not always be able to convert the dataset to stationary and homoscedastic data. This can be observed by performing checks using tools such as stationarity_tests
in Darts.

Homoscedasticity and heteroscedasticity. (2023, June 2). In Wikipedia. https://en.wikipedia.org/wiki/Homoscedasticity_and_heteroscedasticity ↩