Forecaster
BoxCoxBiasAdjustedForecaster
Box-Cox Bias-Adjusted Forecaster.
This module implements a forecaster that applies Box-Cox transformation and bias adjustment to the predictions of a wrapped forecaster.
The bias adjustment is applied to both point predictions and prediction intervals using the bias correction formula for inverse Box-Cox transforms:
\[y_t = \text{inv\_boxcox}(w_t, \lambda) \cdot [1 + \sigma_t^2(1-\lambda)/ (2(\lambda w_t + 1)^2)]\]
where: - \(y_t\) is the back-transformed forecast at time t - \(w_t\) is the transformed data at time t - \(\lambda\) is the Box-Cox parameter - \(\sigma_t^2\) is the forecast variance on the transformed scale at time t
Quickstart
python
from sktime.forecasting.boxcox_biasadj import BoxCoxBiasAdjustedForecaster
estimator = BoxCoxBiasAdjustedForecaster(forecaster, lambda_fixed=None)Parameters(2)
- forecasterBaseForecaster
- The wrapped forecaster to which Box-Cox transformation and bias adjustment will be applied.
- lambda_fixedfloat, optional (default=None)
- The Box-Cox transformation parameter. If None, it will be estimated.
Examples
>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.boxcox_bias_adjusted_forecaster import (
... BoxCoxBiasAdjustedForecaster,
... )
>>> from sktime.forecasting.naive import NaiveForecaster
>>> y = load_airline ()
>>> # Define the forecasting horizon
>>> fh = [1, 2, 3 ]
>>> # wrap a forecaster with Box-Cox bias adjustment
>>> forecaster = BoxCoxBiasAdjustedForecaster (NaiveForecaster ())
>>> forecaster. fit (y, fh = fh) BoxCoxBiasAdjustedForecaster(
... )
>>> y_pred = forecaster. predict ()References
[1]
Hyndman, R.J., & Athanasopoulos, G. (2018) “Forecasting: principles and practice”, 2nd edition, Section 2.7 - Box-Cox Transformations, OTexts: Melbourne, Australia. OTexts.com/fpp2