code from: Cross-lags and the unbiased estimation of life-history and demographic parameters

code from: Cross-lags and the unbiased estimation of life-history and demographic parameters