Hire a web Developer and Designer to upgrade and boost your online presence with cutting edge Technologies

Thursday 8 August 2024

How to Model Residual Errors to Correct Time Series Forecasts with Python

 The residual errors from forecasts on a time series provide another source of information that we can model.

Residual errors themselves form a time series that can have temporal structure. A simple autoregression model of this structure can be used to predict the forecast error, which in turn can be used to correct forecasts. This type of model is called a moving average model, the same name but very different from moving average smoothing.

In this tutorial, you will discover how to model a residual error time series and use it to correct predictions with Python.

After completing this tutorial, you will know:

  • About how to model residual error time series using an autoregressive model.
  • How to develop and evaluate a model of residual error time series.
  • How to use a model of residual error to correct predictions and improve forecast skill.

    Model of Residual Errors

    The difference between what was expected and what was predicted is called the residual error.

    It is calculated as:

    Just like the input observations themselves, the residual errors from a time series can have temporal structure like trends, bias, and seasonality.

    Any temporal structure in the time series of residual forecast errors is useful as a diagnostic as it suggests information that could be incorporated into the predictive model. An ideal model would leave no structure in the residual error, just random fluctuations that cannot be modeled.

    Structure in the residual error can also be modeled directly. There may be complex signals in the residual error that are difficult to directly incorporate into the model. Instead, you can create a model of the residual error time series and predict the expected error for your model.

    The predicted error can then be subtracted from the model prediction and in turn provide an additional lift in performance.

    A simple and effective model of residual error is an autoregression. This is where some number of lagged error values are used to predict the error at the next time step. These lag errors are combined in a linear regression model, much like an autoregression model of the direct time series observations.

    An autoregression of the residual error time series is called a Moving Average (MA) model. This is confusing because it has nothing to do with the moving average smoothing process. Think of it as the sibling to the autoregressive (AR) process, except on lagged residual error rather than lagged raw observations.

    In this tutorial, we will develop an autoregression model of the residual error time series.

    Before we dive in, let’s look at a univariate dataset for which we will develop a model.

No comments:

Post a Comment

Connect broadband

7 Ways to Handle Large Data Files for Machine Learning

 Exploring and applying machine learning algorithms to datasets that are too large to fit into memory is pretty common. This leads to quest...