THE Z-TRANSFORMED DISCRETE CORRELATION FUNCTION (ZDCF)
The ZDCF is a widely used algorithm to robustly estimate the cross-correlation function (CCF) of discrete, sparse astronomical time series.
Reference: Tal Alexander, 1997,
Is AGN Variability Correlated with Other AGN Properties?
ZDCF Analysis of Small Samples of Sparse Light Curves
in Astronomical Time Series,
Eds. D. Maoz, A. Sternberg, and E.M. Leibowitz,
(Dordrecht: Kluwer), p. 163.
The uncertainty in the most likely time-lag in the data (technically, the error on the CCF peak) can be obtained by a likelihood method, PLIKE, as explained in an extended description of the ZDCF algorithm. The PLIKE source code (Fortran 77, Fortran 95) is freely available. (please credit by citing). See usage instructions in the comments at the beginning of the source code.