HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

R Tutorial : White noise

6,890 views March 15, 2020 3:12

Watch on YouTube
ChannelDataCamp

Description from the creator

Want to learn more? Take the full course at learn.datacamp.com/courses/forecasting-using-r at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.

---

Let me show you the most boring time series you will ever see. It is just random, independent and identically distributed observations. In short-hand, statisticians often call this "iid data". In other words, there is nothing going on -- no trend, no seasonality, no cyclicity, not even any autocorrelations. Just randomness.

In time series, we call it "white noise". The name comes from physics where white light has some similar mathematical characteristics.

Although it appears boring, it is a very important type of time series because it is the basis of almost all forecasting models.

The autocorrelation() function of white noise consists of many insignificant spikes. Because the data is simply random, we expect correlations between observations to be close to zero. The dashed blue lines are there to show us how large a spike has to be before we can consider it significantly different from zero. In this example, the first 15 spikes are all within the blue lines, as we would expect. Even the largest spike at lag 10 is well within the range we would expect for a white noise series.

The blue lines are based on the sampling distribution for autocorrelation assuming the data are white noise. Any spike within the blue lines should be ignored. Spikes outside the blue lines might indicate something interesting in the data. At least, they suggest there may be some information that we could use in building a forecasting model.

Here is a time series showing the number of pigs slaughtered each month in my home state of Victoria. This is the series underpinning the pork chops and bacon I sometimes enjoy.

At first glance, it looks relatively random. Possibly there's a slight upward trend, but it is hard to see the difference between this and a white noise series on the basis of a time plot.

But when we look at the ACF plot of the same data, we can see there is actually some information in the data. The first three spikes are significantly larger than zero. So we can be confident that this is not a white noise series. In other words, there is some information in the data that can be used in building a forecasting model.

Looking at an ACF is useful, but sometimes it is easier to test all the autocorrelations together, rather than consider each one separately. To do this, we can use a Ljung-Box test. It considers the first h autocorrelation values to see if they, as a group, look like what you would expect from a white noise series.

We can apply it to the first 24 autocorrelations we saw in the ACF plot for the pigs data set. Here the p-value is very small, again suggesting that this is not a white noise series.

To summarize, white noise is a purely random time series.

Often we will use a Ljung-Box test to see if we have a white noise series. If we don't have white noise, we can then look at the ACF to see which spikes are the most significant.

Now it's your turn to try these ideas on another time series.

#DataCamp #RTutorial #ForecastinginR

About this tutorial

DataCamp published this 3:12 video tutorial on March 15, 2020. It has been watched 6,890 times on YouTube.

Channel
DataCamp
Duration
3:12
Published
March 15, 2020
Views
6,890
Likes
76

Tags

Share

This tutorial in other languages