avatarHair Parra

Summary

The provided content offers an introduction to the Innovations algorithm for time series analysis, detailing its recursive computational process and practical application using R, with a focus on the wine dataset.

Abstract

The article delves into the Innovations algorithm, a method for iteratively predicting time series data. It builds upon the concepts of the best linear predictor (BLP) and minimum mean square error (MSE) to define one-step innovations, which are prediction errors. The algorithm is presented with mathematical rigor, including the use of vectors and matrices to facilitate computations, and assumes the time series to be stationary or transformable into a stationary series. The article also demonstrates the practical use of the algorithm with R's wine dataset, performing inference, checking for stationarity, and applying ARMA models, with a note that the proof of correctness for the algorithm is complex and not included. The Innovations algorithm is shown to be a powerful tool for time series prediction, with the itmsr package in R being utilized for its implementation.

Opinions

  • The author emphasizes the importance of stationarity in time series data for the effective application of the Innovations algorithm.
  • The article suggests that the Innovations algorithm is part of a series of methods for time series analysis, with the Durbin-Levinson algorithm being covered in a previous article.
  • Visual diagnostic plots are recommended alongside statistical tests to assess the stationarity of the time series data.
  • The author expresses that the Innovations algorithm is best understood when its computational steps are broken down and when its practical application is demonstrated through coding examples.
  • The article hints at future discussions on ARMA processes, indicating a structured approach to teaching time series analysis.
  • The author provides links to additional resources, such as lecture slides and previous articles, to encourage further learning on the topic.

A Complete Introduction To Time Series Analysis (with R):: Innovations Algorithm

The Innovations algorithm recursive computation

In the last article, we studied in depth the famous Durbin-Levinson algorithm, which allowed us to recursively compute the coefficients of the best linear predictor given by

satisfying the following

, without having to explictly invert the Gamma matrix. In this short article, we will take a look at the Innovations algorithm, another algorithm that will allow us to iteratively make predictions.

Innovations algorithm

We will now take a look at the Innovations algorithm. First, we are going to re-define the BLP of X_{n} as follows:

Next, we define the MSE as you might expect:

We define the one-step innovations as (prediction errors) as

That is,

At this point, you can already see that each “innovation” is definininf the difference by adding one prediction at the time. In order to facilitate computations, we define the following vectors:

That is, this is just a collection of the observations and the innovations, defined as column vectors.

which contains a collection of coefficients for each BLP at each timestep. We now propose the next claim without proof:

This is why if we want to use this algorithm, we will actually want our series to be stationary, or to be turned into one, and be able to assess this using statistical tests and diagnostics. Now, provided that our A_{n} matrix is non-singular (therefore invertible), we can define the matrix

Now, we define the matrix

that is

Which is the same matrix, without the diagonal 1’s. Then, we have, using some simply algebra that

So that

Now, why is this useful? Rememer that these are vectors, which means that we can use these step-predictions to make a new one as follows:

Finally, as you might expect, there is a way to compute thesre recursively. Let

Then, we can compute

and that’s it! The proof of correctness of this algorithm is rather involved, so I will not present it here, but if you are interested, you can check out these lecture slides. We will come back to this algorithm later when we show predictions for it.

How to R

For this example, we will use wine dataset , already built-in in R. First, let’s import some libraries:

Next, let’s inspect the data. It looks as follows:

From documentation: “The wine dataset contains the results of a chemical analysis of wines grown in a specific area of Italy. Three types of wine are represented in the 178 samples, with the results of 13 chemical analyses recorded for each sample.” We will perform inference on this data using the Innovations algorithm in the itmsr package. Let’s now plot the data:

This data actually has a yearly seasonality, so we will use a lag of 12. We will fit a model implictly and then check for stationarity using the tests we presented before:

According to the tests, there is a strong evidence that the residual series is stationary. as we fail to reject the null hypothesis in the majority of the tests. We can also verify this visually with the diagnostic plots:

This is still not the best, but it is a good application of the Classical Decomposition model. We can also fit an ARMA(p,q) model as follows (we will study these next!). We can use these residuals to apply an ARMA(p,q) model on top:

and we see that this one definitely looks stationary from the tests and diagnostic plots. Finally, we can use the calssical decomposition transformations and the fitted ARMA model to obtain predictions as follows:

Which under the hood, uses precisely the Innovations algorithm.

Next time

This concludes the end of this chapter! In the next article, we will begin our discussion of ARMA processes, which will allow us to combine the power of AR(p) and MA(q) processes into one. Stay tuned, and happy learning!

Last time

Durbin-Levinson algorithm

Main page

Follow me at

  1. https://www.linkedin.com/in/hair-parra-526ba19b/
  2. https://github.com/JairParra
  3. https://medium.com/@hair.parra
Machine Learning
Statistics
Forecasting
Time Series Analysis
Mathematics
Recommended from ReadMedium