Julia provides some functions to facilitate correlation analysis. Correlation and dependence are two common terms in statistics. Dependence refers to one variable having a statistical relationship with another variable, whereas correlation is one variable having a much wider class of relationship with the other variable, which may also include dependence.
The autocov(x)
function is used to compute auto-covariance of x
. It returns a vector of the same size as x
.
This is a dataset we generated. We can apply autocov
on this dataset:
To compute auto-correlation, we use the autocor
function:
Similarly, we can also compute cross-covariance and cross-correlation. For that, we will generate another random array of the same size:
Cross-covariance and cross-correlation of 2 arrays of length=6 results in arrays of lengths=11.