Hello,

I want to calculate the prior estimation of the dispersion parameter theta but having some problems. Any help highly appreciated.

**What the paper tells me**

In the DSS Bayesian hierarchical model, the biological variation among replicates of a group is captured by the beta distribution. The parameters of the beta distribution are mu (mean methylation) and theta (dispersion). Thereby theta is relative to the group mean.

The prior on theta is thought as a log-normal distribution theta = log-normal (m_0j, r_0j^2). The mean (m_0j) and variance (r_0j^2) can be estimated from the data. To do so, a method of moments (MOM) estimator is applied to each CpG site in order to estimate the dispersion parameters. For the MOM estimator I used a Parameter Estimation for the Beta Distribution (https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=2613&context=etd; alpha 2.19, beta 2.20). The distribution of log(theta) should be normal distributed with parameter m_0j, r_0j^2.

**What I don't get**

What mean/variance do I plug into the MOM estimator for beta and alpha? For the mean, do I use the ratio of methylated/total reads per CpG? Or do I use the group mean e.g. the total number of methylated reads divided by the total number of reads per sample. Next, I am wondering how to calculate the variance? The mean methylation is a continuis variable but what values do I substract? I used the number of methylated reads (1) and number of unmethylated reads (o) to calculate (X - mean(X)) ^2. But that seems awfully wrong.

Second, do I understand correctly, that the MOM estimates are used as prior theta and the log-normal distribution is just a "visual" conformation that this is possible?

**Good by cruel world**

I hope you can help me. I tried to get all the information from the paper https://academic.oup.com/nar/article-lookup/doi/10.1093/nar/gku154 but it is my first approach to understand a Bayesian Hierarchical Model and right now I need some push in the right direction

[To get my own prior which I can update, I guess ;) ]

Best

Florian