Hello I am attempting to implement a discrete correlation function for two astronomical light curves but I am struggling with the final steps of the math. The steps are as follows:
- Given two datasets $(a_i, t_{ai})$ and $(b_j, t_{bj})$, construct two matrices: the unbinned discrete correlation function (UDCF) and the associated lag times
$$UDCF_{ij} = \frac{(a_i - \bar a)(b_j - \bar b)}{\sigma_a \sigma_b}$$ $$\Delta t_{ij} = t_j - t_i$$
- Then Group the UDCF "into a univariate function of lag time $\tau$ by collecting the $M(\tau)$ data pairs with lags falling within the interval $\tau - \Delta \tau/2 \leq \Delta t_{ij} < \tau + \Delta\tau/2$. This produces the discrete correlation function:
$$DCF(\tau) = \frac{1}{M(\tau)}\sum_{k=1}^{M(\tau)}UDCF_{ij}$$
Step 2 is what I am struggling to understand. How does one group a matrix into a one variable function? I suppose my problem is in computing the $M(\tau)$ data pairs, which I imagine is produced by looking at the inequality provided. But how does one compare a matrix like $\Delta t_{ij}$ to a variable like lag time and bin size $(\Delta \tau)$? I apologize if my questions are a bit too general, but I'm afraid my total confusion on this step is making it difficult to be more specific. I have very little background in statistics and correlation functions. I'd appreciate any help or suggestions you can provide.
I believe the summation should be done by all $(i,j)$ pairs that satisfy $\tau - \Delta \tau/2 \leq \Delta t_{ij} < \tau + \Delta\tau/2$ condition: $$ DCF(\tau) = \sum_{(i,j):\, \tau - \frac{\Delta\tau}{2} \leq \Delta t_{ij} < \tau + \frac{\Delta\tau}{2}} UDCF_{ij} $$ And $M(\tau)$ is simply the number of such pairs (and hence the number of summands).
Since each $UDCF_{ij}$ is just a number for any pair $(i,j)$, the sum also would be a number, not a matrix. In fact the "matrix" term is very misleading here, since no matrix operation is involved. Just treat them as numbers associated with each $(i,j)$ pair.
The bin size $\Delta \tau$ should be picked to some constant value before computing $DCF(\tau)$.