The data model of Baldur assumes that the observations of a peptide,
\(\boldsymbol{Y}\), is a normally distributed with a standard deviation,
\(\sigma\), common to all measurements. In addition, it assumes that each
measurement has a unique uncertainty \(u\). It then models all
measurements in the same condition with a common mean \(\mu\). It then
assumes that the common variation of the peptide is caused by the variation
in the \(\mu\) As such, it models \(\mu\) with the common variance
\(\sigma\) and a non-centered parametrization for condition level
effects.
$$
\boldsymbol{Y}\sim\mathcal{N}(\boldsymbol{X}\boldsymbol{\mu},\sigma\boldsymbol{u})\quad
\boldsymbol{\mu}\sim\mathcal{N}(\mu_0+\boldsymbol{\eta}\sigma,\sigma)
$$
It then assumes \(\sigma\) to be gamma distributed with hyperparameters
infered from either a gamma regression fit_gamma_regression or a latent
gamma mixture regression fit_lgmr. $$\sigma\sim\Gamma(\alpha,\beta)$$
For details on the two priors for \(\mu_0\) see empirical_bayes or
weakly_informative. Baldur then builds a posterior distribution of the
difference(s) in means for contrasts of interest. In addition, Baldur
increases the precision of the decision as the number of measurements
increase. This is done by weighting the sample size with the contrast
matrix. To this end, Baldur limits the possible contrast of interest such
that each column must sum to zero, and the absolute value of each column
must sum to two. That is, only mean comparisons are allowed.
$$
\boldsymbol{D}\sim\mathcal{N}(\boldsymbol{\mu}^\text{T}\boldsymbol{K},\sigma\boldsymbol{\xi}),\quad \xi_{i}=\sqrt{\sum_{c=1}^{C}|k_{cm}|n_c^{-1}}
$$
where \(\boldsymbol{K}\) is a contrast matrix of interest and
\(k_{cm}\) is the contrast of the c:th condition in the m:th contrast of
interest, and \(n_c\) is the number of measurements in the c:th
condition. Baldur then integrates the tails of \(\boldsymbol{D}\) to
determine the probability of error.
$$P(\text{\textbf{error}})=2\Phi(-\left|\boldsymbol{\mu}_{\boldsymbol{D}}-H_0\right|\odot\boldsymbol{\tau}_{\boldsymbol{D}})$$
where \(H_0\) is the null hypothesis for the difference in means,
\(\Phi\) is the CDF of the standard normal,
\(\boldsymbol{\mu}_{\boldsymbol{D}}\) is the posterior mean of
\(\boldsymbol{D}\), \(\boldsymbol{\tau}_{\boldsymbol{D}}\) is the
posterior precision of \(\boldsymbol{D}\), and \(\odot\) is the
Hadamard product.