1
$\begingroup$

What is the difference between cross-correlation and pearsons r correlation for two different signals? It will be very grateful if somebody explains with an example

$\endgroup$
1
$\begingroup$

Loosely speaking, cross-correlation is a generalization of the Pearson's correlation. Specifically, when comparing two time series, cross-correlation seeks to obtain a relationship between lags of each series.

For example, assume two time series, $x_t$ and $y_t$, each with $T$ observations. Also, let $\bar{x}$ and $\bar{y}$ represent the sample means and let $\sigma_x^2$ and $\sigma_y^2$ represent the sample variance. The sample cross-correlation is obtained as follows:

$$\frac{\sum_t^T(x_t-\bar{x})\sum_s^T(y_s-\bar{y})}{\sigma_x\sigma_y}$$

Notice the subscripts, with the cross-variance I will compare $x_t$ to lags of $y_{t-s}$ and vice versa. As a result, with only two series the cross-correlation generates a $T\text{x}T$ matrix (i.e. the above sample cross variance will be entry ($t$,$s$) within the matrix). Pearson's correlation is actually contained within this cross-correlation matrix, i.e.

$$\frac{\sum_{t=1}^T(x_t-\bar{x})\sum_{t=1}^T(y_{t}-\bar{y})}{\sigma_x\sigma_y}$$

Which will be the first entry of the diagonal.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy