avatarHair Parra

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2740

Abstract

wish to estimate. For instance, we can set</p><figure id="a0bd"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Yb1vg-DHjVrdyle6uQ0MPQ.png"><figcaption></figcaption></figure><p id="1fd7">to estimate some lag h. This estimator is in fact <b>biased</b> but <b>consistent, </b>and it turns out this seems to work better than other unbiased estimators.</p><p id="7853"><b>Sample autocorrelation</b></p><p id="53d1">Just as you would expect, we have</p><figure id="eedd"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*UBiS5_ZHvGevyCrtsktqBQ.png"><figcaption></figcaption></figure><p id="760d">Further, we have that this estimator follows <b>asymptotic normality, </b>which means that it tends to behave like a normal distribution as the sample increases. More formally,</p><figure id="a610"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*s295qzJ9fgefX3SjAy6kLw.png"><figcaption></figcaption></figure><p id="5282">This will be very useful in the next section where we will study tests for stationarity, as several of them rely on normality assumptions. The proof of this proposition is rather hard to explain, so I won’t go over it here, but if you are curious it uses the <b>Law of Large Numbers</b> and <b>Slutsky’s Theorem</b> to show that</p><figure id="525f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*UKAW0j2oDjkVreJErkDBtA.png"><figcaption></figcaption></figure><p id="eaa4">The superscript d here means that the left estimator “converges in distribution” to a normal random variable.</p><h2 id="3d51">Next time</h2><p id="dc20">So that’s it for this short article! Next time we will learn a bunch of useful tests to check for stationarity of different series, using both parametric and non-parametric methods, along with illustrations in R. Stay tuned, and until next time!</p><div id="1699" class="link-block"> <a href="https://readmedium.com/a-complete-introduction-to-time-series-analysis-with-r-tests-for-stationarity-a8f1966a7c88"> <div> <div> <h2>A Complete Introduction To Time Series Analysis (with R):: Tests for Stationarity</h2> <div><h3>In the last article, we saw how we could estimate autocovariance by using a slightly modified version of the typical…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*T5B9y-PmVHXUtJuop0qekQ.png)"></div> </div> </div> </a> </div><h2 id="805f">Last time</h2><p id="1cc6"><a href="https://medium.com/@hair.parra/a-complete-introduction-to-time-series-anal

Options

ysis-with-r-properties-of-the-autocovariance-6c7308437e5a">Properties of the autocovariance function</a></p><div id="36a2" class="link-block"> <a href="https://medium.com/@hair.parra/a-complete-introduction-to-time-series-analysis-with-r-properties-of-the-autocovariance-6c7308437e5a"> <div> <div> <h2>A Complete Introduction To Time Series Analysis (with R):: Properties of the Autocovariance…</h2> <div><h3>Recall that back in our discussion of stationary processes, we discussed the autocovariance function as well as the ACF…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*I7WxHXuEuoxL1JhH.png)"></div> </div> </div> </a> </div><h2 id="c1a0">Main page</h2><div id="aad1" class="link-block"> <a href="https://readmedium.com/a-complete-introduction-to-time-series-analysis-with-r-9882f2d44c9d"> <div> <div> <h2>A Complete Introduction To Time Series Analysis (with R)</h2> <div><h3>During these times of the Covid19 pandemic, you have perhaps heard about the collaborative efforts to predict new…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*TL2PeOANEN4zG0_OqoHptQ.jpeg)"></div> </div> </div> </a> </div><h2 id="ab2d">Follow me at</h2><ol><li><a href="https://blog.jairparraml.com/">https://blog.jairparraml.com/</a></li><li><a href="https://www.linkedin.com/in/hair-parra-526ba19b/">https://www.linkedin.com/in/hair-parra-526ba19b/</a></li><li><a href="https://github.com/JairParra">https://github.com/JairParra</a></li><li><a href="https://medium.com/@hair.parra">https://medium.com/@hair.parra</a></li></ol><div id="ad7a" class="link-block"> <a href="https://www.linkedin.com/in/hair-parra-526ba19b/"> <div> <div> <h2>Hair Parra — Software Engineer / Data Engineer — DevX Analytics — Cisco | LinkedIn</h2> <div><h3>https://blog.jairparraml.com/ *** B.A. major Computer Science. Double minor in Statistics and Linguistics, at McGill…</h3></div> <div><p>www.linkedin.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*Gt9zNNKhbJ9iCLEV)"></div> </div> </div> </a> </div></article></body>

A Complete Introduction To Time Series Analysis (with R):: Estimating Autocorrelation

Over-differenced LakeHuron series data ACF. Ideally, a stationary series should have most lags within the confidence bounds.

In the last article, we went over a couple of important properties of the autocovariance function, and in previous articles, we have used multiple times the ggAcf and ggPacf functions to plot the ACF and PACF respectively. But how are these actually estimated them, and how do we know that they are being correctly estimated (and hopefully not too off from the truth)? In this short article, we will explain precisely that. Let’s start!

Estimating autocovariance

Suppose that you have some time series with observed values

Then we have the following:

Sample mean

This one is probably not surprising. The interesting one is the following:

Sample autocovariance

further, this implies that

Why is this the case? First recall that the covariance between two vectors U and V is given by

When it comes to the sample version of these estimators, you can think as replacing the expectation operator by some average with the data; so, in this case, we would get

if the lowercase indexed u and v represent the random vector (observed ) components. For time series, however, both “u” and “v” come from the same data, and since we actually want to estimate the autocovariance at different lags, what we want to do instead is to “shift” the data around by the lag we wish to estimate. For instance, we can set

to estimate some lag h. This estimator is in fact biased but consistent, and it turns out this seems to work better than other unbiased estimators.

Sample autocorrelation

Just as you would expect, we have

Further, we have that this estimator follows asymptotic normality, which means that it tends to behave like a normal distribution as the sample increases. More formally,

This will be very useful in the next section where we will study tests for stationarity, as several of them rely on normality assumptions. The proof of this proposition is rather hard to explain, so I won’t go over it here, but if you are curious it uses the Law of Large Numbers and Slutsky’s Theorem to show that

The superscript d here means that the left estimator “converges in distribution” to a normal random variable.

Next time

So that’s it for this short article! Next time we will learn a bunch of useful tests to check for stationarity of different series, using both parametric and non-parametric methods, along with illustrations in R. Stay tuned, and until next time!

Last time

Properties of the autocovariance function

Main page

Follow me at

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