Bernoulli model

Description

The Bernoulli model is a model of binary data.

Definition

For binary outcome \(y\) and predictors \(x\), the model is:

\[ \begin{align} y_i &\sim \text{Bernoulli}(\text{logit}^{-1}(\eta_i)) \\ \eta_i &= \alpha + \beta \cdot x_i \end{align} \]

Parameters needing priors

  • \(\alpha\) (intercept)
  • \(\beta\) (predictor weights)

Prior on \(\alpha\)

Weakly informative logistic prior

Greenland and Mansournia (2015) found that a logistic function prior provided a good default.

\(\alpha \sim \text{logistic}(\sigma)\)

Boonstra, Barbaro, and Sen (2019) suggests that \(\sigma\) should be chosen by:

  1. choose constant \(0 \lt q \lt 1\) which is prior mass outside extreme boundaries. e.g. 0.01

  2. calculate \(s_n = \exp{-1 / (2n)}\), where \(n\) is number of observations

  3. select \(\sigma = \sigma_n\) such that \(P(1 - s_n < \text{logit}^{-1}(\alpha) < s_n | \sigma = \sigma_n) = 1 - q\).

logis_sigma <- function(n, q) {

  s_n <- exp(-1 / (2 * n))

  root <- uniroot(
    \(sigma) plogis(q = qlogis(s_n), scale = sigma,
                    lower.tail = FALSE) - q/2,
    interval = c(0.1, 10))

  root$root
}

Weakly informative exponential power prior

Boonstra, Barbaro, and Sen (2019) suggested an exponential power prior:

\(p(\alpha) \propto \exp{(-\text{abs}({\alpha / \sqrt(2) \sigma})^\gamma)}\)

target += -abs((alpha) / (sqrt(2.0) * alpha_scale))^(alpha_power);

Similar to the method for the logistic prior, choosing \(\sigma\) can be done with the following function:

ep_sigma <- function(gamma, n, q) {

  s_n <- exp(-1 / (2 * n))

  root <- uniroot(
    \(sigma) pgamma(q = (qlogis(s_n) / (sqrt(2) * sigma))^gamma,
      shape = 1 / gamma, lower.tail = FALSE) - q,
    interval = c(0, 10))

  root$root
}

Prior on \(\beta\)

Weakly informative Student-t prior

Ghosh, Li, and Mitra (2018) suggested a Student-t prior on scaled predictors.

\(\beta \sim \text{StudentT}(\nu, 0, \sigma)\)

With \(\nu\) between 3 and 7, and \(\nu = 7\), \(\sigma\) = 2.5 sensible defaults.

See also

References

Boonstra, Philip S., Ryan P. Barbaro, and Ananda Sen. 2019. “Default Priors for the Intercept Parameter in Logistic Regressions.” Computational Statistics & Data Analysis 133 (May): 245–56. https://doi.org/10.1016/j.csda.2018.10.014.
Ghosh, Joyee, Yingbo Li, and Robin Mitra. 2018. “On the Use of Cauchy Prior Distributions for Bayesian Logistic Regression.” Bayesian Analysis 13 (2): 359–83. https://doi.org/10.1214/17-BA1051.
Greenland, Sander, and Mohammad Ali Mansournia. 2015. “Penalization, Bias Reduction, and Default Priors in Logistic and Related Categorical and Survival Regressions.” Statistics in Medicine 34 (23): 3133–43. https://doi.org/10.1002/sim.6537.