Consider two samples ${(x_i)}_{i=1}^M$ and ${(y_i)}_{i=1}^N$, where $M = N$, respectively of two sequence of independent but not identically distributed random variables $(X_i)_{i=1}^M$ and $(Y_i)_{i=1}^M$, but the samples are paired in the sense that $X_i$ is not independent from $Y_i$. I would like to know whether the sample means $\bar{x}$ and $\bar{y}$ are significantly different from each other, by using bootstrapping. I will describe two plausible methods to do this. I am confused as to which method is more appropriate. This question is related to the following questions, however in these cases $M \neq N$:
Non-parametric confidence interval about the difference of means for unpaired data
Confidence interval for the difference of two means using boot package in R
Method 1: This method treats the data as unpaired as per the above questions.
- Sample $M$ points with replacement from ${(x_i)}_{i=1}^M$, calculate the bootstrapped mean $\bar{x}^*$.
- Sample $M$ points with replacement from ${(y_i)}_{i=1}^M$, calculate the bootstrapped mean $\bar{y}^*$.
- Calculate the bootstrap difference in means $\delta^* = \bar{x}^* - \bar{y}^*$.
- Repeat steps 1-3 as many times as necessary to get the bootstrap population of the bootstrap difference, and construct the 95% confidence interval as usual.
Method 2: This method treats the data as paired.
- Sample $M$ indices with replacement from the indices $1, 2, \dots, M$.
- Construct samples from ${(x_i)}_{i=1}^M$ and ${(y_i)}_{i=1}^M$ by taking the elements of the sequence given by the indices from step 1. Find the bootstrap means $\bar{x}^*$ and $\bar{y}^*$ from these samples.
- Repeat steps 1-2 as necessary, and construct the 95% confidence interval as usual.
The difference between Method 1 and 2 is that in method one the two bootstrap samples are derived independently.
Example use case:
We have two statistical models $\mathcal{P_1}=\{P_{\theta_1}\}$ and $\mathcal{P_2}=\{P_{\theta_2}\}$ respectively parametrized by $\theta_1$ and $\theta_2$ for a sequence of independent, but not identically distributed, random variables $(Z_i)_{i=1}^M$. For a sequence of sammples $(z_i)_i$ of $(Z_i)_i$, we can calculate the log-likelihood of each model, for each observation $z_i$. These log-likelihoods are are samples of the random variable representing the log-likelihood of each model. Then, I would like to see whether the mean log-likelihood value calculated from these samples significantly differ from each other.