*3.1. Simulation Results*

A total of 1000 replicates were simulated. For each replicate, the Bayes factor was calculated for each moving window with window size of 6. Calculations were based on 3000 Gibbs samplers, with 1000 Gibbs samplers for the burn-in period. The results of simulation for both the scenarios are presented in Table 2. As expected, the results are very similar for both scenarios. The results of Scenario 1 are plotted in Figures 1 and 2. As evident from Table 2, following Jeffreys' rule, when the

moving windows contain at least three of the six CpG sites, we have strong evidence of differential methylation when sample size of 50 in each group and decisive evidence when sample size is 100.


**Table 2.** Mean Bayes factors at each CpG site, based on simulation studies.

**Figure 1.** Mean of Bayes factors at each CpG site with *N* = 50 (Scenario 1).

All results show that the Bayes factors reach their maximum in the simulated DMR (CpG sites 10–15). However, the Bayes factors are not symmetric, the windows on the right side of the peak have larger values compared to those on the left side. This is attributed to the fact that the methylation status at a given site was generated conditional on that at the previous site of the same sequence. As expected, when the sample size is doubled the Bayes factors and the evidence in support of methylation increases significantly, as seen in Table 2 and Figures 1 and 2.

In order to illustrate that our proposed method is statistically valid and to ensure that the BF in our method is a meaningful measure for comparison with frequentist approaches, we computed Bayes factors exclusively for all moving windows that do not include the differentially methylated sites 10–11. Among these Bayes factors, 95% were less than 1.34 and 99% were less than 1.50, both consistent with Jeffreys' rule. These values can be thought of as the cut-offs corresponding to 5% and 1% empirical type I error rates. We calculated the proportions of times the Bayes factors fall above these cut-offs, for all

possible numbers of DMCs in the moving window. These results are given in Table 3. For the simulated data they are comparable to the conclusions based on frequentist interpretations of type I error and power. For the real data analysis, one could employ a permutation test to derive the cutoff values under the null hypothesis. However, since the frequentist interpretation is not necessarily consistent with the Bayesian conclusions, using Jeffrey's rule for decision making may be more desirable when analyzing real data.

**Figure 2.** Mean of Bayes factors at each CpG site with *N* = 100 (Scenario 1).


**Table 3.** Proportions of Bayes factors that fell above the cut-off.
