I'm struggling to understand whether a data stream sliced up in a certain way could produce two quantities that are dependent but uncorrelated.
Suppose I have two iid streams of data that are independent of each other: $X = (X_1, X_2, \ldots)$ and $Y = (Y_1, Y_2, \ldots)$. I want to estimate the difference in means between the two groups. Between the two streams, I want to sample a total of $n$ points. For notation's sake, say I'm sampling one point per unit of time for $T$ total time units.
Now consider the following sampling scheme which divides up the $T$ time period into two halves:
- Up until time $t = T/2$, sample from $X$ and $Y$ with equal probability.
- From $t = (T/2+1)$ until $T$, sample from $X$ with probability $p$ and from $Y$ with probability $1-p$, where $p$ is some function of the data I observed in the first half and also $p \in (0,1)$.
Now consider $\hat{\theta}_1 := \bar{X}_1 - \bar{Y}_1$, the difference in sample means calculated from only the data collected up until time $t=T/2$ and $\hat{\theta}_2 := \bar{X}_2 - \bar{Y}_2$ calculated from only the data collected from time $t=(T/2+1)$ to $t=T$.
Question: Without knowing more about how $p$ depends on the data in the first half, can we tell whether $\hat{\theta}_1$ and $\hat{\theta}_2$ are correlated?
Obviously, $\hat{\theta}_1$ and $\hat{\theta}_2$ are not independent, but nevertheless I thought they would be uncorrelated. My reasoning was that the dependence of $p$ only affects the allocation between $X$ and $Y$, and doesn't introduce any bias as far as the expected value of $\bar{X} - \bar{Y}$. I feel like I oversimplified this, but I'm a bit stuck as to how to work this out rigorously.
EDIT: As an answer below pointed out, this problem may be more interesting if we restrict $p \in (0,1)$. Or to put it another way, if we require $\bar{X}_1, \bar{X}_2, \bar{Y}_1$ and $\bar{Y}_2$ to all have nonzero probability of containing points. Edit made above.
So I thought about my own question for a bit and realized that the answer is totally straightforward.
If $p$ is bounded away from 0 and 1 then $E(\hat{\theta_2} | \hat{\theta_1}) = E(\hat{\theta_2})$ since the samples are iid across the two halves and the dependence only changes the sampling probability between the halves. Then we can simply calculate
$$ E(\hat{\theta}_1 \cdot \hat{\theta}_2) = E(E(\hat{\theta}_1 \cdot \hat{\theta}_2 | \hat{\theta}_1)) = E(\hat{\theta}_1 \cdot E(\hat{\theta}_2 | \hat{\theta}_1) = E(\hat{\theta}_1) \cdot E(\hat{\theta}_2) $$
And therefore the covariance between $\hat{\theta}_1$ and $\hat{\theta}_2$ is zero.