The
C_CORRELATE
function computes the
cross correlation *
Pxy*
(*
L*
) or
cross covariance *
Rxy*
(*
L*
) of two sample populations *
X*
and *
Y*
as a function of the lag *
L*
.

where*
`*
*
x *
and*
`*
*
y *
are the means of the sample populations *
x*
= (*
x*
_{
0}
, *
x*
_{
1}
, *
x*
_{
2}
, ... , *
x*
_{
N-1}
) and *
y *
= (*
y*
_{
0}
, *
y*
_{
1}
, *
y*
_{
2}
, ... , *
y*
_{
N-1}
), respectively.

This routine is written in the IDL language. Its source code can be found in the file ```
c_correlate.pro
```

in the ```
lib
```

subdirectory of the IDL distribution.

Define two n-element sample populations.

X = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57]

Y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95]

Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7

A_CORRELATE , CORRELATE , M_CORRELATE , P_CORRELATE , R_CORRELATE