Autocorrelation: Difference between revisions

Jump to navigation Jump to search
imported>OAbot
m Open access bot: url-access updated in citation with #oabot.
 
imported>Citation bot
Altered journal. Add: doi-access, doi-broken-date, bibcode. | Use this bot. Report bugs. | Suggested by Headbomb | #UCB_toolbar
 
Line 1: Line 1:
{{Short description|Correlation of a signal with a time-shifted copy of itself, as a function of shift}}
{{Short description|Correlation of a signal with a time-shifted copy of itself, as a function of shift}}
{{Correlation and covariance}}
{{Correlation and covariance}}
[[File:Acf new.svg|thumb|300px|right|Above: A plot of a series of 100 random numbers concealing a [[sine]] function. Below: The sine function revealed in a [[correlogram]] produced by autocorrelation.]]
[[File:Acf new.svg|thumb|300px|right|Above: A plot of a series of 100 random numbers concealing a [[sine]] function. Below: Its [[correlogram]] plots the autocorrelation function (ACF) of the series on the y-axis for every lag on the x-axis. Peaks occur at lags where the series is highly correlated with itself. Peaks to the right of the initial peak at lag 0 indicate periodicity in the series and help estimate the concealed sine's period.]]
[[File:Comparison convolution correlation.svg|thumb|400px|Visual comparison of convolution, [[cross-correlation]], and '''autocorrelation'''.  For the operations involving function {{mvar|f}}, and assuming the height of {{mvar|f}} is 1.0, the value of the result at 5 different points is indicated by the shaded area below each point.  Also, the symmetry of {{mvar|f}} is the reason <math>g*f</math> and <math>f \star g</math> are identical in this example.
[[File:Comparison convolution correlation.svg|thumb|400px|Visual comparison of convolution, [[cross-correlation]], and '''autocorrelation'''.  For the operations involving function {{mvar|f}}, and assuming the height of {{mvar|f}} is 1.0, the value of the result at 5 different points is indicated by the shaded area below each point.  Also, the symmetry of {{mvar|f}} is the reason <math>g*f</math> and <math>f \star g</math> are identical in this example.
<!--Note that g∗f and f∗g would be identical even without the symmetry of f, so please don't change the statement above.-->]]
<!--Note that g∗f and f∗g would be identical even without the symmetry of f, so please don't change the statement above.-->]]


'''Autocorrelation''', sometimes known as '''serial correlation''' in the [[discrete time]] case, measures the [[correlation]] of a [[Signal (information theory)|signal]] with a delayed copy of itself. Essentially, it quantifies the similarity between observations of a [[random variable]] at different points in time. The analysis of autocorrelation is a mathematical tool for identifying repeating patterns or hidden [[Periodic function|periodicities]] within a signal obscured by [[noise (signal processing)|noise]]. Autocorrelation is widely used in [[signal processing]], [[time domain]] and [[time series analysis]] to understand the behavior of data over time.  
'''Autocorrelation''', sometimes known as '''serial correlation''' in the [[discrete time]] case, measures the [[correlation]] of a [[Signal (information theory)|signal]] with a delayed copy of itself. Essentially, it quantifies the similarity between observations of a [[random variable]] at different points in its [[Domain of a function|domain]] (commonly, [[time]]). The analysis of autocorrelation is a mathematical tool for identifying repeating patterns or hidden [[Periodic function|periodicities]] within a signal obscured by [[noise (signal processing)|noise]]. Autocorrelation is widely used in [[signal processing]], [[time domain]] and [[time series analysis]] to understand the behavior of data over time.  


Different fields of study define autocorrelation differently, and not all of these definitions are equivalent. In some fields, the term is used interchangeably with [[autocovariance]].  
Different fields of study define autocorrelation differently, and not all of these definitions are equivalent. In some fields, the term is used interchangeably with [[autocovariance]].  
Line 12: Line 12:


== Autocorrelation of stochastic processes ==
== Autocorrelation of stochastic processes ==
In [[statistics]], the autocorrelation of a real or complex [[random process]] is the [[Pearson correlation coefficient|Pearson correlation]] between values of the process at different times, as a function of the two times or of the time lag. Let <math>\left\{ X_t \right\}</math> be a random process, and <math>t</math> be any point in time (<math>t</math> may be an [[integer]] for a [[discrete-time]] process or a [[real number]] for a [[continuous-time]] process). Then <math>X_t</math> is the value (or [[Realization (probability)|realization]]) produced by a given [[Execution (computing)|run]] of the process at time <math>t</math>. Suppose that the process has [[mean]] <math>\mu_t</math> and [[variance]] <math>\sigma_t^2</math> at time <math>t</math>, for each <math>t</math>. Then the definition of the '''autocorrelation function''' between times <math>t_1</math> and <math>t_2</math> is<ref name=Gubner>{{cite book |first=John A. |last=Gubner |year=2006 |title=Probability and Random Processes for Electrical and Computer Engineers |publisher=Cambridge University Press |isbn=978-0-521-86470-1}}</ref>{{rp|p.388}}<ref name=KunIlPark>Kun Il Park, Fundamentals of Probability and Stochastic Processes with Applications to Communications, Springer, 2018, {{ISBN|978-3-319-68074-3}}</ref>{{rp|p.165}}
In [[statistics]], the autocorrelation of a real or complex [[random process]] is the [[Pearson correlation coefficient|Pearson correlation]] between values of the process at different times, as a function of the two times or of the time lag. Let <math>\left\{ X_t \right\}</math> be a random process over time and <math>X_t</math> be the random variable at time <math>t</math>. (<math>t</math> may be an [[integer]] for a [[discrete-time]] process or a [[real number]] for a [[continuous-time]] process.) Then the definition of the '''autocorrelation function''' between times <math>t_1</math> and <math>t_2</math> is<ref name=Gubner>{{cite book |first=John A. |last=Gubner |year=2006 |title=Probability and Random Processes for Electrical and Computer Engineers |publisher=Cambridge University Press |isbn=978-0-521-86470-1}}</ref>{{rp|p=388}}<ref name=KunIlPark>Kun Il Park, Fundamentals of Probability and Stochastic Processes with Applications to Communications, Springer, 2018, {{ISBN|978-3-319-68074-3}}</ref>{{rp|p=165}}


{{Equation box 1
{{Equation box 1
Line 24: Line 24:
where <math>\operatorname{E}</math> is the [[expected value]] operator and the bar represents [[complex conjugation]]. Note that the expectation may not be [[well defined]].
where <math>\operatorname{E}</math> is the [[expected value]] operator and the bar represents [[complex conjugation]]. Note that the expectation may not be [[well defined]].


Subtracting the mean before multiplication yields the '''auto-covariance function''' between times <math>t_1</math> and <math>t_2</math>:<ref name=Gubner/>{{rp|p.392}}<ref name=KunIlPark/>{{rp|p.168}}
Suppose that the process has [[mean]] <math>\mu_t</math> and [[variance]] <math>\sigma_t^2</math> at time <math>t</math>, for each <math>t</math>. Subtracting the mean before multiplication yields the '''auto-covariance function''' between times <math>t_1</math> and <math>t_2</math>:<ref name=Gubner/>{{rp|p=392}}<ref name=KunIlPark/>{{rp|p=168}}


{{Equation box 1
{{Equation box 1
Line 43: Line 43:


=== Definition for wide-sense stationary stochastic process ===
=== Definition for wide-sense stationary stochastic process ===
If <math>\left\{ X_t \right\}</math> is a [[wide-sense stationary process]] then the mean <math>\mu</math> and the variance <math>\sigma^2</math> are time-independent, and further the autocovariance function depends only on the lag between <math>t_1</math> and <math>t_2</math>: the autocovariance depends only on the time-distance between the pair of values but not on their position in time. This further implies that the autocovariance and autocorrelation can be expressed as a function of the time-lag, and that this would be an [[even function]] of the lag  <math>\tau=t_2-t_1</math>. This gives the more familiar forms for the '''autocorrelation function'''<ref name=Gubner/>{{rp|p.395}}
If <math>\left\{ X_t \right\}</math> is a [[wide-sense stationary process]] then the mean <math>\mu</math> and the variance <math>\sigma^2</math> are time-independent, and further the autocovariance function depends only on the lag between <math>t_1</math> and <math>t_2</math>: the autocovariance depends only on the time-distance between the pair of values but not on their position in time. This further implies that the autocovariance and autocorrelation can be expressed as a function of the time-lag, and that this would be an [[even function]] of the lag  <math>\tau=t_2-t_1</math>. This gives the more familiar forms for the '''autocorrelation function'''<ref name=Gubner/>{{rp|p=395}}


{{Equation box 1
{{Equation box 1
Line 76: Line 76:
It is common practice in some disciplines (e.g. statistics and [[time series analysis]]) to normalize the autocovariance function to get a time-dependent [[Pearson correlation coefficient]]. However, in other disciplines (e.g. engineering) the normalization is usually dropped and the terms "autocorrelation" and "autocovariance" are used interchangeably.
It is common practice in some disciplines (e.g. statistics and [[time series analysis]]) to normalize the autocovariance function to get a time-dependent [[Pearson correlation coefficient]]. However, in other disciplines (e.g. engineering) the normalization is usually dropped and the terms "autocorrelation" and "autocovariance" are used interchangeably.


The definition of the autocorrelation coefficient of a stochastic process is<ref name=KunIlPark/>{{rp|p.169}}
The definition of the autocorrelation coefficient of a stochastic process is<ref name=KunIlPark/>{{rp|p=169}}


<math display=block>\rho_{XX}(t_1,t_2) = \frac{\operatorname{K}_{XX}(t_1,t_2)}{\sigma_{t_1}\sigma_{t_2}} = \frac{\operatorname{E}\left[(X_{t_1} - \mu_{t_1}) \overline{(X_{t_2} - \mu_{t_2})} \right]}{\sigma_{t_1}\sigma_{t_2}} .</math>
<math display="block">\begin{align}
\rho_{XX}(t_1,t_2) &= \frac{\operatorname{K}_{XX}(t_1,t_2)}{\sigma_{t_1}\sigma_{t_2}} \\
&= \frac{\operatorname{E}\left[\left(X_{t_1} - \mu_{t_1}\right) \overline{\left(X_{t_2} - \mu_{t_2}\right)} \right]}{\sigma_{t_1}\sigma_{t_2}} .
\end{align}</math>


If the function <math>\rho_{XX}</math> is well defined, its value must lie in the range <math>[-1,1]</math>, with 1 indicating perfect correlation and −1 indicating perfect [[anti-correlation]].
If the function <math>\rho_{XX}</math> is well defined, its value must lie in the range <math>[-1,1]</math>, with 1 indicating perfect correlation and −1 indicating perfect [[anti-correlation]].
Line 84: Line 87:
For a [[Stationary process#wide-sense stationarity|wide-sense stationary]] (WSS) process, the definition is
For a [[Stationary process#wide-sense stationarity|wide-sense stationary]] (WSS) process, the definition is


<math display=block>\rho_{XX}(\tau) = \frac{\operatorname{K}_{XX}(\tau)}{\sigma^2} = \frac{\operatorname{E} \left[(X_{t+\tau} - \mu)\overline{(X_{t} - \mu)}\right]}{\sigma^2}</math>.
<math display="block">\rho_{XX}(\tau) = \frac{\operatorname{K}_{XX}(\tau)}{\sigma^2} = \frac{\operatorname{E} \left[(X_{t+\tau} - \mu)\overline{(X_{t} - \mu)}\right]}{\sigma^2}.</math>


The normalization is important both because the interpretation of the autocorrelation as a correlation provides a scale-free measure of the strength of [[statistical dependence]], and because the normalization has an effect on the statistical properties of the estimated autocorrelations.
The normalization is important both because the interpretation of the autocorrelation as a correlation provides a scale-free measure of the strength of [[statistical dependence]], and because the normalization has an effect on the statistical properties of the estimated autocorrelations.
Line 90: Line 93:
===Properties===
===Properties===
====Symmetry property====
====Symmetry property====
The fact that the autocorrelation function <math>\operatorname{R}_{XX}</math> is an [[even function]] can be stated as<ref name=KunIlPark/>{{rp|p.171}}
The fact that the autocorrelation function <math>\operatorname{R}_{XX}</math> is an [[even function]] can be stated as<ref name=KunIlPark/>{{rp|p=171}}
<math display=block>\operatorname{R}_{XX}(t_1,t_2) = \overline{\operatorname{R}_{XX}(t_2,t_1)}</math>
<math display=block>\operatorname{R}_{XX}(t_1,t_2) = \overline{\operatorname{R}_{XX}(t_2,t_1)}</math>
respectively for a WSS process:<ref name=KunIlPark/>{{rp|p.173}}
respectively for a WSS process:<ref name=KunIlPark/>{{rp|p=173}}
<math display=block>\operatorname{R}_{XX}(\tau) = \overline{\operatorname{R}_{XX}(-\tau)} .</math>
<math display=block>\operatorname{R}_{XX}(\tau) = \overline{\operatorname{R}_{XX}(-\tau)} .</math>


====Maximum at zero====
====Maximum at zero====
For a WSS process:<ref name=KunIlPark/>{{rp|p.174}}
For a WSS process:<ref name=KunIlPark/>{{rp|p=174}}
<math display=block>\left|\operatorname{R}_{XX}(\tau)\right| \leq \operatorname{R}_{XX}(0)</math>
<math display=block>\left|\operatorname{R}_{XX}(\tau)\right| \leq \operatorname{R}_{XX}(0)</math>
Notice that <math>\operatorname{R}_{XX}(0)</math> is always real.
Notice that <math>\operatorname{R}_{XX}(0)</math> is always real.


====Cauchy–Schwarz inequality====
====Cauchy–Schwarz inequality====
The [[Cauchy–Schwarz inequality]], inequality for stochastic processes:<ref name=Gubner/>{{rp|p.392}}
The [[Cauchy–Schwarz inequality]], inequality for stochastic processes:<ref name=Gubner/>{{rp|p=392}}
<math display=block>\left|\operatorname{R}_{XX}(t_1,t_2)\right|^2 \leq \operatorname{E}\left[ |X_{t_1}|^2\right] \operatorname{E}\left[|X_{t_2}|^2\right]</math>
<math display=block>\left|\operatorname{R}_{XX}(t_1,t_2)\right|^2 \leq \operatorname{E}\left[ |X_{t_1}|^2\right] \operatorname{E}\left[|X_{t_2}|^2\right]</math>


Line 110: Line 113:
The [[Wiener–Khinchin theorem]] relates the autocorrelation function <math>\operatorname{R}_{XX}</math> to the [[spectral density|power spectral density]] <math>S_{XX}</math> via the [[Fourier transform]]:
The [[Wiener–Khinchin theorem]] relates the autocorrelation function <math>\operatorname{R}_{XX}</math> to the [[spectral density|power spectral density]] <math>S_{XX}</math> via the [[Fourier transform]]:


<math display=block>\operatorname{R}_{XX}(\tau) = \int_{-\infty}^\infty S_{XX}(f) e^{i 2 \pi f \tau} \, {\rm d}f</math>
<math display="block">\begin{align}
 
\operatorname{R}_{XX}(\tau) &= \int_{-\infty}^\infty S_{XX}(\omega) e^{i \omega \tau} \, {\rm d}\omega \\[1ex]
<math display=block>S_{XX}(f) = \int_{-\infty}^\infty \operatorname{R}_{XX}(\tau) e^{- i 2 \pi f \tau} \, {\rm d}\tau .</math>
S_{XX}(\omega) &= \int_{-\infty}^\infty \operatorname{R}_{XX}(\tau) e^{- i \omega \tau} \, {\rm d}\tau .
\end{align}</math>


For real-valued functions, the symmetric autocorrelation function has a real symmetric transform, so the [[Wiener–Khinchin theorem]] can be re-expressed in terms of real cosines only:
For real-valued functions, the symmetric autocorrelation function has a real symmetric transform, so the [[Wiener–Khinchin theorem]] can be re-expressed in terms of real cosines only:


<math display=block>\operatorname{R}_{XX}(\tau) = \int_{-\infty}^\infty S_{XX}(f) \cos(2 \pi f \tau) \, {\rm d}f</math>
<math display="block">\begin{align}
 
\operatorname{R}_{XX}(\tau) &= \int_{-\infty}^\infty S_{XX}(\omega) \cos(\omega \tau) \, {\rm d}\omega \\[1ex]
<math display=block>S_{XX}(f) = \int_{-\infty}^\infty \operatorname{R}_{XX}(\tau) \cos(2 \pi f \tau) \, {\rm d}\tau .</math>
S_{XX}(\omega) &= \int_{-\infty}^\infty \operatorname{R}_{XX}(\tau) \cos(\omega \tau) \, {\rm d}\tau .
\end{align}</math>


==Autocorrelation of random vectors{{anchor|Matrix}}==
==Autocorrelation of random vectors{{anchor|Matrix}}==
Line 124: Line 129:
The (potentially time-dependent) '''autocorrelation matrix''' (also called second moment) of a (potentially time-dependent) [[random vector]] <math>\mathbf{X} = (X_1,\ldots,X_n)^{\rm T}</math> is an <math>n \times n</math> matrix containing as elements the autocorrelations of all pairs of elements of the random vector <math>\mathbf{X}</math>. The autocorrelation matrix is used in various [[digital signal processing]] algorithms.
The (potentially time-dependent) '''autocorrelation matrix''' (also called second moment) of a (potentially time-dependent) [[random vector]] <math>\mathbf{X} = (X_1,\ldots,X_n)^{\rm T}</math> is an <math>n \times n</math> matrix containing as elements the autocorrelations of all pairs of elements of the random vector <math>\mathbf{X}</math>. The autocorrelation matrix is used in various [[digital signal processing]] algorithms.


For a [[random vector]] <math>\mathbf{X} = (X_1,\ldots,X_n)^{\rm T}</math> containing [[random element]]s whose [[expected value]] and [[variance]] exist, the '''autocorrelation matrix''' is defined by<ref name=Papoulis>Papoulis, Athanasius, ''Probability, Random variables and Stochastic processes'', McGraw-Hill, 1991</ref>{{rp|p.190}}<ref name=Gubner/>{{rp|p.334}}
For a [[random vector]] <math>\mathbf{X} = (X_1,\ldots,X_n)^{\rm T}</math> containing [[random element]]s whose [[expected value]] and [[variance]] exist, the '''autocorrelation matrix''' is defined by<ref name=Papoulis>Papoulis, Athanasius, ''Probability, Random variables and Stochastic processes'', McGraw-Hill, 1991</ref>{{rp|p=190}}<ref name=Gubner/>{{rp|p=334}}


{{Equation box 1
{{Equation box 1
Line 135: Line 140:
|background colour=#F5FFFA}}
|background colour=#F5FFFA}}


where <math>{}^{\rm T}</math> denotes the [[transpose]]d matrix of dimensions <math>n \times n</math>.
where <math>{}^{\rm T}</math> denotes [[transpose|transposition]] of the vector.


Written component-wise:
<math>\operatorname{R}_{\mathbf{X}\mathbf{X}}</math> is a matrix of dimensions <math>n \times n</math>:


<math display=block>\operatorname{R}_{\mathbf{X}\mathbf{X}} =
<math display="block">\operatorname{R}_{\mathbf{X}\mathbf{X}} =
\begin{bmatrix}
\begin{bmatrix}
\operatorname{E}[X_1 X_1] & \operatorname{E}[X_1 X_2] & \cdots & \operatorname{E}[X_1 X_n] \\ \\
\operatorname{E}[X_1 X_1] & \operatorname{E}[X_1 X_2] & \cdots & \operatorname{E}[X_1 X_n] \\ \\
\operatorname{E}[X_2 X_1] & \operatorname{E}[X_2 X_2] & \cdots & \operatorname{E}[X_2 X_n] \\ \\
\operatorname{E}[X_2 X_1] & \operatorname{E}[X_2 X_2] & \cdots & \operatorname{E}[X_2 X_n] \\ \\
  \vdots & \vdots & \ddots & \vdots \\ \\
  \vdots & \vdots & \ddots & \vdots \\ \\
\operatorname{E}[X_n X_1] & \operatorname{E}[X_n X_2] & \cdots & \operatorname{E}[X_n X_n] \\ \\
\operatorname{E}[X_n X_1] & \operatorname{E}[X_n X_2] & \cdots & \operatorname{E}[X_n X_n]
\end{bmatrix}
\end{bmatrix}
</math>
</math>
For example, if <math>\mathbf{X} = \left( X_1,X_2,X_3 \right)^{\rm T}</math> is a random vector, then <math>\operatorname{R}_{\mathbf{X}\mathbf{X}}</math> is a <math>3 \times 3</math> matrix whose <math>(i,j)</math>-th entry is <math>\operatorname{E}[X_i X_j]</math>.


If <math>\mathbf{Z}</math> is a [[complex random vector]], the autocorrelation matrix is instead defined by
If <math>\mathbf{Z}</math> is a [[complex random vector]], the autocorrelation matrix is instead defined by
Line 153: Line 160:


Here <math>{}^{\rm H}</math> denotes [[Hermitian transpose]].
Here <math>{}^{\rm H}</math> denotes [[Hermitian transpose]].
For example, if <math>\mathbf{X} = \left( X_1,X_2,X_3 \right)^{\rm T}</math> is a random vector, then <math>\operatorname{R}_{\mathbf{X}\mathbf{X}}</math> is a <math>3 \times 3</math> matrix whose <math>(i,j)</math>-th entry is <math>\operatorname{E}[X_i X_j]</math>.


===Properties of the autocorrelation matrix===
===Properties of the autocorrelation matrix===
* The autocorrelation matrix is a [[Hermitian matrix]] for complex random vectors and a [[symmetric matrix]] for real random vectors.<ref name=Papoulis />{{rp|p.190}}
* The autocorrelation matrix is a [[Hermitian matrix]] for complex random vectors and a [[symmetric matrix]] for real random vectors.<ref name=Papoulis />{{rp|p=190}}
* The autocorrelation matrix is a [[positive semidefinite matrix]],<ref name=Papoulis />{{rp|p.190}} i.e. <math>\mathbf{a}^{\mathrm T} \operatorname{R}_{\mathbf{X}\mathbf{X}} \mathbf{a} \ge 0 \quad \text{for all } \mathbf{a} \in \mathbb{R}^n</math> for a real random vector, and respectively <math>\mathbf{a}^{\mathrm H} \operatorname{R}_{\mathbf{Z}\mathbf{Z}} \mathbf{a} \ge 0 \quad \text{for all } \mathbf{a} \in \mathbb{C}^n</math> in case of a complex random vector.
* The autocorrelation matrix is a [[positive semidefinite matrix]],<ref name=Papoulis />{{rp|p=190}} i.e. <math>\mathbf{a}^{\mathrm T} \operatorname{R}_{\mathbf{X}\mathbf{X}} \mathbf{a} \ge 0 \quad \text{for all } \mathbf{a} \in \mathbb{R}^n</math> for a real random vector, and respectively <math>\mathbf{a}^{\mathrm H} \operatorname{R}_{\mathbf{Z}\mathbf{Z}} \mathbf{a} \ge 0 \quad \text{for all } \mathbf{a} \in \mathbb{C}^n</math> in case of a complex random vector.
* All eigenvalues of the autocorrelation matrix are real and non-negative.
* All eigenvalues of the autocorrelation matrix are real and non-negative.
* The ''auto-covariance matrix'' is related to the autocorrelation matrix as follows:<!--
* The ''auto-covariance matrix'' is related to the autocorrelation matrix as follows:<!--
 
--><math display="block">\begin{align}
--><math display=block>\operatorname{K}_{\mathbf{X}\mathbf{X}} = \operatorname{E}[(\mathbf{X} - \operatorname{E}[\mathbf{X}])(\mathbf{X} - \operatorname{E}[\mathbf{X}])^{\rm T}] =  \operatorname{R}_{\mathbf{X}\mathbf{X}} - \operatorname{E}[\mathbf{X}] \operatorname{E}[\mathbf{X}]^{\rm T}</math><!--
\operatorname{K}_{\mathbf{X}\mathbf{X}} &= \operatorname{E}\left[(\mathbf{X} - \operatorname{E}[\mathbf{X}])(\mathbf{X} - \operatorname{E}[\mathbf{X}])^{\rm T}\right] \\
 
&=  \operatorname{R}_{\mathbf{X}\mathbf{X}} - \operatorname{E}[\mathbf{X}] \operatorname{E}[\mathbf{X}]^{\rm T}
\end{align}</math><!--
-->Respectively for complex random vectors:<!--
-->Respectively for complex random vectors:<!--
 
--><math display="block">\begin{align}
--><math display=block>\operatorname{K}_{\mathbf{Z}\mathbf{Z}} = \operatorname{E}[(\mathbf{Z} - \operatorname{E}[\mathbf{Z}])(\mathbf{Z} - \operatorname{E}[\mathbf{Z}])^{\rm H}] =  \operatorname{R}_{\mathbf{Z}\mathbf{Z}} - \operatorname{E}[\mathbf{Z}] \operatorname{E}[\mathbf{Z}]^{\rm H}</math>
\operatorname{K}_{\mathbf{Z}\mathbf{Z}} &= \operatorname{E}\left[(\mathbf{Z} - \operatorname{E}[\mathbf{Z}])(\mathbf{Z} - \operatorname{E}[\mathbf{Z}])^{\rm H}\right] \\
&=  \operatorname{R}_{\mathbf{Z}\mathbf{Z}} - \operatorname{E}[\mathbf{Z}] \operatorname{E}[\mathbf{Z}]^{\rm H}
\end{align}</math>


== Autocorrelation of deterministic signals ==
== Autocorrelation of deterministic signals ==
Line 172: Line 180:


=== Autocorrelation of continuous-time signal ===
=== Autocorrelation of continuous-time signal ===
Given a [[Signal (electronics)|signal]] <math>f(t)</math>, the continuous autocorrelation <math>R_{ff}(\tau)</math> is most often defined as the continuous [[cross-correlation]] integral of <math>f(t)</math> with itself, at lag <math>\tau</math>.<ref name=Gubner/>{{rp|p.411}}
Given a [[Signal (electronics)|signal]] <math>f(t)</math>, the continuous autocorrelation <math>R_{ff}(\tau)</math> is most often defined as the continuous [[cross-correlation]] integral of <math>f(t)</math> with itself, at lag <math>\tau</math>.<ref name=Gubner/>{{rp|p=411}}


{{Equation box 1
{{Equation box 1
Line 232: Line 240:
** the autocorrelation is an [[even function]] <math>R_{ff}(-\tau) = R_{ff}(\tau)</math> when <math>f</math> is a real function, and
** the autocorrelation is an [[even function]] <math>R_{ff}(-\tau) = R_{ff}(\tau)</math> when <math>f</math> is a real function, and
** the autocorrelation is a [[Hermitian function]] <math>R_{ff}(-\tau) = R_{ff}^*(\tau)</math> when <math>f</math> is a [[complex function]].
** the autocorrelation is a [[Hermitian function]] <math>R_{ff}(-\tau) = R_{ff}^*(\tau)</math> when <math>f</math> is a [[complex function]].
* The continuous autocorrelation function reaches its peak at the origin, where it takes a real value, i.e. for any delay <math>\tau</math>, <math>|R_{ff}(\tau)| \leq R_{ff}(0)</math>.<ref name=Gubner/>{{rp|p.410}} This is a consequence of the [[rearrangement inequality]]. The same result holds in the discrete case.
* The continuous autocorrelation function reaches its peak at the origin, where it takes a real value, i.e. for any delay <math>\tau</math>, <math>|R_{ff}(\tau)| \leq R_{ff}(0)</math>.<ref name=Gubner/>{{rp|p=410}} This is a consequence of the [[rearrangement inequality]]. The same result holds in the discrete case.
* The autocorrelation of a [[periodic function]] is, itself, periodic with the same period.
* The autocorrelation of a [[periodic function]] is, itself, periodic with the same period.
* The autocorrelation of the sum of two completely uncorrelated functions (the cross-correlation is zero for all <math>\tau</math>) is the sum of the autocorrelations of each function separately.
* The autocorrelation of the sum of two completely uncorrelated functions (the cross-correlation is zero for all <math>\tau</math>) is the sum of the autocorrelations of each function separately.
Line 247: Line 255:


==Efficient computation==
==Efficient computation==
For data expressed as a [[Discrete signal|discrete]] sequence, it is frequently necessary to compute the autocorrelation with high [[algorithmic efficiency|computational efficiency]]. A [[brute force method]] based on the signal processing definition <math>R_{xx}(j) = \sum_n x_n\,\overline{x}_{n-j}</math> can be used when the signal size is small. For example, to calculate the autocorrelation of the real signal sequence <math>x = (2,3,-1)</math> (i.e. <math>x_0=2, x_1=3, x_2=-1</math>, and <math>x_i = 0</math> for all other values of {{mvar|i}}) by hand, we first recognize that the definition just given is the same as the "usual" multiplication, but with right shifts, where each vertical addition gives the autocorrelation for particular lag values:
For data expressed as a [[Discrete signal|discrete]] sequence, it is frequently necessary to compute the autocorrelation with high [[algorithmic efficiency|computational efficiency]]. A [[brute force method]] based on the signal processing definition <math display="inline">R_{xx}(j) = \sum_n x_n\,\overline{x}_{n-j}</math> can be used when the signal size is small. For example, to calculate the autocorrelation of the real signal sequence <math>x = (2,3,-1)</math> (i.e. <math>x_0=2, x_1=3, x_2=-1</math>, and <math>x_i = 0</math> for all other values of {{mvar|i}}) by hand, we first recognize that the definition just given is the same as the "usual" multiplication, but with right shifts, where each vertical addition gives the autocorrelation for particular lag values:
<math display=block>\begin{array}{rrrrrr}
<math display=block>\begin{array}{rrrrrr}
       & 2 & 3 & -1 \\
       & 2 & 3 & -1 \\
Line 284: Line 292:


The advantage of estimates of the last type is that the set of estimated autocorrelations, as a function of <math>k</math>, then form a function which is a valid autocorrelation in the sense that it is possible to define a theoretical process having exactly that autocorrelation. Other estimates can suffer from the problem that, if they are used to calculate the variance of a linear combination of the <math>X</math>'s, the variance calculated may turn out to be negative.<ref>{{Cite journal|last=Percival|first=Donald B.|date=1993|title=Three Curious Properties of the Sample Variance and Autocovariance for Stationary Processes with Unknown Mean|journal=The American Statistician|language=en|volume=47|issue=4|pages=274–276|doi=10.1080/00031305.1993.10475997}}</ref>
The advantage of estimates of the last type is that the set of estimated autocorrelations, as a function of <math>k</math>, then form a function which is a valid autocorrelation in the sense that it is possible to define a theoretical process having exactly that autocorrelation. Other estimates can suffer from the problem that, if they are used to calculate the variance of a linear combination of the <math>X</math>'s, the variance calculated may turn out to be negative.<ref>{{Cite journal|last=Percival|first=Donald B.|date=1993|title=Three Curious Properties of the Sample Variance and Autocovariance for Stationary Processes with Unknown Mean|journal=The American Statistician|language=en|volume=47|issue=4|pages=274–276|doi=10.1080/00031305.1993.10475997}}</ref>
== Hassani −1/2 theorem ==
In time series analysis, the '''Hassani −1/2 theorem''' is a finite-sample identity concerning the conventional estimator of the ''sample autocorrelation function'' (ACF). For a time series of length <math>T\ge 2</math>, using the usual sample-mean-corrected estimator <math>\hat\rho(h)</math>, Hassani showed that the sum of the sample autocorrelations over all positive lags is constant:<ref name="Hassani2009">{{cite journal |last=Hassani |first=Hossein |year=2009 |title=Sum of the sample autocorrelation function |journal=Random Operators and Stochastic Equations |volume=17 |issue=2 |pages=125–130 |doi=10.1515/ROSE.2009.008}}</ref>
<math display="block">
\sum_{h=1}^{T-1}\hat\rho(h) = -\tfrac12 .
</math>
The identity follows from the fact that the sample autocovariances are computed after subtracting the sample mean. Consequently, the centered observations sum to zero, which imposes an algebraic constraint on the full set of sample autocorrelations. The theorem is therefore a property of the estimator and the finite sample, rather than a property of the underlying stochastic process.
The result implies that sample autocorrelations across lags are not independent. It also shows that the sample ACF cannot be positive overall when summed across all positive lags. This has led to cautions against interpreting the sum of estimated autocorrelations as a direct measure of total dependence, persistence or long-memory behaviour, since the full-lag sum is fixed at <math>-1/2</math> regardless of the underlying stationary time series.<ref name="Hassani2009" /><ref name="Hassani2010">{{cite journal |last=Hassani |first=Hossein |year=2010 |title=A note on the sum of the sample autocorrelation function |journal=Physica A: Statistical Mechanics and Its Applications |volume=389 |issue=8 |pages=1601–1606 |doi=10.1016/j.physa.2009.12.050 |bibcode=2010PhyA..389.1601H }}</ref>
The theorem has been discussed in relation to diagnostic checking and model selection in time series analysis. In particular, later work has examined its implications for tests based on sample autocorrelations, including the Ljung–Box statistic, and for the interpretation of empirical ACF patterns in short-memory and long-memory processes.<ref name="HassaniYeganegi2019">{{cite journal |last1=Hassani |first1=Hossein |last2=Yeganegi |first2=Mohammad Reza |year=2019 |title=Sum of squared ACF and the Ljung–Box statistics |journal=Physica A: Statistical Mechanics and Its Applications |volume=520 |pages=81–86 |doi=10.1016/j.physa.2018.12.095 |doi-broken-date=26 May 2026 }}</ref><ref name="Hassani2024ACF">{{cite journal |last1=Hassani |first1=Hossein |last2=Royer-Carenzi |first2=Manuela |last3=Yeganegi |first3=Mohammad Reza |year=2024 |title=Exploring the Depths of the Autocorrelation Function: Its Departure from Normality |journal=Information |volume=15 |issue=8 |pages=449 |doi=10.3390/info15080449 |doi-access=free }}</ref> The identity has also been used to emphasize the distinction between theoretical autocorrelations of a process and empirical autocorrelations estimated from a finite sample.<ref name="Hassani2025WhiteNoise">{{cite journal |last1=Hassani |first1=Hossein |last2=Mashhad |first2=Leila Marvian |last3=Royer-Carenzi |first3=Manuela |last4=Yeganegi |first4=Mohammad Reza |last5=Komendantova |first5=Nadejda |year=2025 |title=White Noise and Its Misapplications: Impacts on Time Series Model Adequacy and Forecasting |journal=Forecasting |volume=7 |issue=1 |pages=8 |doi=10.3390/forecast7010008 |doi-access=free }}</ref>
The theorem applies to the standard sample-mean-corrected ACF estimator. It should not be confused with statements about the sum of the theoretical autocorrelation function of the underlying process, which may vary depending on the model and its parameters.<ref name="Hassani2010" />


==Regression analysis==
==Regression analysis==
Line 304: Line 327:
* Utilized in the [[GPS]] system to correct for the [[propagation delay]], or time shift, between the point of time at the transmission of the [[carrier signal]] at the satellites, and the point of time at the receiver on the ground.  This is done by the receiver generating a replica signal of the 1,023-bit C/A (Coarse/Acquisition) code, and generating lines of code chips [-1,1] in packets of ten at a time, or 10,230 chips (1,023 × 10), shifting slightly as it goes along in order to accommodate for the [[doppler shift]] in the incoming satellite signal, until the receiver replica signal and the satellite signal codes match up.<ref>{{cite book |last1=Van Sickle |first1=Jan |title=GPS for Land Surveyors |date=2008 |publisher=CRC Press |isbn=978-0-8493-9195-8 |pages=18–19 |edition=Third}}</ref>
* Utilized in the [[GPS]] system to correct for the [[propagation delay]], or time shift, between the point of time at the transmission of the [[carrier signal]] at the satellites, and the point of time at the receiver on the ground.  This is done by the receiver generating a replica signal of the 1,023-bit C/A (Coarse/Acquisition) code, and generating lines of code chips [-1,1] in packets of ten at a time, or 10,230 chips (1,023 × 10), shifting slightly as it goes along in order to accommodate for the [[doppler shift]] in the incoming satellite signal, until the receiver replica signal and the satellite signal codes match up.<ref>{{cite book |last1=Van Sickle |first1=Jan |title=GPS for Land Surveyors |date=2008 |publisher=CRC Press |isbn=978-0-8493-9195-8 |pages=18–19 |edition=Third}}</ref>
* The [[small-angle X-ray scattering]] intensity of a nanostructured system is the Fourier transform of the spatial autocorrelation function of the [[electron density]].
* The [[small-angle X-ray scattering]] intensity of a nanostructured system is the Fourier transform of the spatial autocorrelation function of the [[electron density]].
*In [[surface science]] and [[scanning probe microscopy]], autocorrelation is used to establish a link between surface morphology and functional characteristics.<ref>{{Cite journal|last1=Kalvani|first1=Payam Rajabi|last2=Jahangiri|first2=Ali Reza|last3=Shapouri|first3=Samaneh|last4=Sari|first4=Amirhossein|last5=Jalili|first5=Yousef Seyed|date=August 2019|title=Multimode AFM analysis of aluminum-doped zinc oxide thin films sputtered under various substrate temperatures for optoelectronic applications|journal=Superlattices and Microstructures|language=en|volume=132|pages=106173|doi=10.1016/j.spmi.2019.106173|s2cid=198468676 }}</ref>
*In [[surface science]] and [[scanning probe microscopy]], autocorrelation is used to establish a link between surface morphology and functional characteristics.<ref>{{Cite journal|last1=Kalvani|first1=Payam Rajabi|last2=Jahangiri|first2=Ali Reza|last3=Shapouri|first3=Samaneh|last4=Sari|first4=Amirhossein|last5=Jalili|first5=Yousef Seyed|date=August 2019|title=Multimode AFM analysis of aluminum-doped zinc oxide thin films sputtered under various substrate temperatures for optoelectronic applications|journal=Superlattices and Microstructures|language=en|volume=132|article-number=106173|doi=10.1016/j.spmi.2019.106173|s2cid=198468676 }}</ref>
* In optics, normalized autocorrelations and cross-correlations give the [[degree of coherence]] of an electromagnetic field.
* In optics, normalized autocorrelations and cross-correlations give the [[degree of coherence]] of an electromagnetic field.
* In [[astronomy]], autocorrelation can determine the [[frequency]] of [[pulsar]]s.
* In [[astronomy]], autocorrelation can determine the [[frequency]] of [[pulsar]]s.
* In [[music]], autocorrelation (when applied at time scales smaller than a second) is used as a [[pitch detection algorithm]] for both instrument tuners and "Auto Tune" (used as a [[Distortion (music)|distortion]] effect or to fix intonation).<ref>{{Cite news
* In [[music]], autocorrelation (when applied at time scales smaller than a second) is used as a [[pitch detection algorithm]] for both instrument tuners and "Auto Tune" (used as a [[Distortion (music)|distortion]] effect or to fix intonation).<ref>{{Cite news
  | last1 = Tyrangiel | first1 = Josh
| last1 = Tyrangiel | first1 = Josh
  | title = Auto-Tune: Why Pop Music Sounds Perfect
  | title = Auto-Tune: Why Pop Music Sounds Perfect
  | magazine = [[Time (magazine)|Time]]
  | magazine = [[Time (magazine)|Time]]
Line 359: Line 382:
* {{cite book |last=Kmenta |first=Jan |author-link=Jan Kmenta |title=Elements of Econometrics |location=New York |publisher=Macmillan |year=1986 |edition=Second |isbn=978-0-02-365070-3 |pages=[https://archive.org/details/elementsofeconom0003kmen/page/298 298–334] |url-access=registration |url=https://archive.org/details/elementsofeconom0003kmen/page/298 }}
* {{cite book |last=Kmenta |first=Jan |author-link=Jan Kmenta |title=Elements of Econometrics |location=New York |publisher=Macmillan |year=1986 |edition=Second |isbn=978-0-02-365070-3 |pages=[https://archive.org/details/elementsofeconom0003kmen/page/298 298–334] |url-access=registration |url=https://archive.org/details/elementsofeconom0003kmen/page/298 }}
* {{cite book|author=Marno Verbeek|author-link = Marno Verbeek|title=A Guide to Modern Econometrics|url=https://books.google.com/books?id=SQxDDwAAQBAJ|date=10 August 2017|publisher=Wiley|isbn=978-1-119-40110-0}}
* {{cite book|author=Marno Verbeek|author-link = Marno Verbeek|title=A Guide to Modern Econometrics|url=https://books.google.com/books?id=SQxDDwAAQBAJ|date=10 August 2017|publisher=Wiley|isbn=978-1-119-40110-0}}
* {{cite journal | url=https://ieeexplore.ieee.org/document/6142119 | doi=10.1109/TSP.2012.2186134 | bibcode=2012ITSP...60.2180S | title=Computational Design of Sequences with Good Correlation Properties | last1=Soltanalian | first1=Mojtaba | last2=Stoica | first2=Petre | journal=IEEE Transactions on Signal Processing | date=2012 | volume=60 | issue=5 | page=2180 | url-access=subscription }}
* {{cite journal | doi=10.1109/TSP.2012.2186134 | bibcode=2012ITSP...60.2180S | title=Computational Design of Sequences with Good Correlation Properties | last1=Soltanalian | first1=Mojtaba | last2=Stoica | first2=Petre | journal=IEEE Transactions on Signal Processing | date=2012 | volume=60 | issue=5 | page=2180 }}
* Solomon W. Golomb, and [[Guang Gong]]. [http://www.cambridge.org/us/academic/subjects/computer-science/cryptography-cryptology-and-coding/signal-design-good-correlation-wireless-communication-cryptography-and-radar Signal design for good correlation: for wireless communication, cryptography, and radar]. Cambridge University Press, 2005.
* Solomon W. Golomb, and [[Guang Gong]]. [http://www.cambridge.org/us/academic/subjects/computer-science/cryptography-cryptology-and-coding/signal-design-good-correlation-wireless-communication-cryptography-and-radar Signal design for good correlation: for wireless communication, cryptography, and radar]. Cambridge University Press, 2005.
* Klapetek, Petr (2018). ''[https://www.elsevier.com/books/quantitative-data-processing-in-scanning-probe-microscopy/klapetek/978-0-12-813347-7 Quantitative Data Processing in Scanning Probe Microscopy: SPM Applications for Nanometrology]'' (Second ed.). Elsevier. pp.&nbsp;108–112  {{ISBN|9780128133477}}.
* Klapetek, Petr (2018). ''[https://www.elsevier.com/books/quantitative-data-processing-in-scanning-probe-microscopy/klapetek/978-0-12-813347-7 Quantitative Data Processing in Scanning Probe Microscopy: SPM Applications for Nanometrology]'' (Second ed.). Elsevier. pp.&nbsp;108–112  {{ISBN|9780128133477}}.
* Hassani, Hossein (2009).  Sum of the sample autocorrelation function. Random Operators and Stochastic Equations. 17 (2): pp. 125–130. ''{{doi|10.1515/ROSE.2009.008}}''.
* Hassani, Hossein (2010). A note on the sum of the sample autocorrelation function]. Physica A: Statistical Mechanics and its Applications. 389 (8): pp. 1601–1606. ''{{doi|10.1016/j.physa.2009.12.050}}''.
* {{MathWorld | urlname=Autocorrelation | title=Autocorrelation}}
* {{MathWorld | urlname=Autocorrelation | title=Autocorrelation}}