Abstract
In Bayesian analysis, the selection of a prior distribution is typically done by considering each parameter in the model. While this can be convenient, in many scenarios it may be desirable to place a prior on a summary measure of the model instead. In this work, we propose a prior on the model fit, as measured by a Bayesian coefficient of determination (), which then induces a prior on the individual parameters. We achieve this by placing a beta prior on and then deriving the induced prior on the global variance parameter for generalized linear mixed models. We derive closed-form expressions in many scenarios and present several approximation strategies when an analytic form is not possible and/or to allow for easier computation. In these situations, we suggest approximating the prior by using a generalized beta prime distribution and provide a simple default prior construction scheme. This approach is quite flexible and can be easily implemented in standard Bayesian software. Lastly, we demonstrate the performance of the method on simulated and real-world data, where the method particularly shines in high-dimensional settings, as well as modeling random effects.
Keywords: Bayesian modeling, Coefficient of determination, Generalized beta prime distribution, Goodness-of-fit
1. Introduction
As computing power has increased and become more accessible, Bayesian inference has risen to prominence. Researchers are now free to consider complex models with many parameters. An advantage of the Bayesian approach is that it can incorporate prior domain knowledge about some parameters to reduce uncertainty. In the absence of such information, we might select vague prior distributions, i.e., prior distributions with large variance. This, however, can lead to some unintended consequences such as Lindley’s paradox (Lindley, 1957). Vague prior distributions can also lead to poor estimates when the number of parameters is large relative to the sample size. This has led to the recent development of shrinkage prior distributions (George and McCulloch, 1993; Ročková and George, 2018; Park and Casella, 2008; Hans, 2009; Carvalho et al., 2010; Bhadra et al., 2017; Bhattacharya et al., 2015; Zhang et al., 2022).
Typically, prior distributions are selected for individual parameters based on domain expertise and/or using a general paradigm, e.g., shrinkage priors. There are situations, however, where researchers may have meaningful prior information on the model in general as opposed to specific regression coefficients. For example, consider genetic association studies (e.g., Lewis and Knight, 2012) where scientists search for the genes that contribute to a specific disease. There may be good understanding of how much genes affect the disease, but little information about which genes are relevant. In this case, it may make more sense to pick a prior for the overall model fit that then induces prior distributions on the parameters. There has been some previous work towards this end. Hodges and Sargent (2001) use a flat prior distribution on the degrees of freedom in a Gaussian mixed effects model. Simpson et al. (2017) introduce a paradigm that penalizes the complexity of the model as measured by the Kullback-Liebler (KL) divergence between the null and fitted model. This method places a prior on this KL divergence, thus shrinking the entire model instead of the individual parameters. Fuglstad et al. (2020) present a user-friendly approach to prior construction by utilizing prior beliefs to apportion the overall variance between different random effect components. The authors construct a joint prior distribution which considers the entire model structure. For Gaussian linear regression, Zhang et al. (2022) place a prior on the model fit as measured by the coefficient of determination, . The authors first derive a Bayesian and show that the prior yields a beta prime prior on the total variance of the regression parameters which is then distributed to each individual parameter through a Dirichlet Decomposition. For sparse high-dimensional regression problems, certain prior choices and a Dirichlet decomposition give posterior consistency. This method is advantageous because is an intuitive measure of model fit and it has excellent shrinkage properties.
In this work, we consider a prior on a summary of model fit by proposing a beta prior on Zhang et al. (2022)’s definition of for generalized linear mixed models. This extends Zhang et al. (2022) beyond linear regression to allow for non-Gaussian responses and random effects. We derive closed-form expressions in multiple scenarios for the prior of the global variance parameter that induces a beta prior on . We also present several approximation strategies when an analytic prior distribution is not possible. The main approach we suggest approximates the prior by a generalized beta prime (GBP) distribution. This distribution is quite flexible as it can achieve boundedness at the origin as well as a heavy tail (Perez et al., 2017). The scaled beta prime distribution, a special case of the GBP, has also previously been used as a prior for the variance of the regression coefficients (Klein et al., 2021; Bai and Ghosh, 2021). Our method, like Zhang et al. (2022), differs from these previous approaches in that we place a GBP prior on the global variance which is then further decomposed in the hierarchy to the individual regression parameters. Our approach also provides an intuitive way to construct informative prior distributions as well as an automatic approach. The proposed methods can be applied using the r2d2glmm package available on GitHub at https://github.com/eyanchenko/r2d2glmm.
The remainder of the paper proceeds as follows. In Section 2, we describe the generalized linear mixed model framework and present several specific examples. In Section 3, we precisely define a Bayesian and show how the model-level prior induces prior distributions for the individual model prior parameters. We also present the prior distributions for several specific regression models as well as approximation techniques when a closed-form solution cannot be found. Section 4 applies the proposed method to real-world data and Section 5 concludes with recommendations for default use and next steps.
2. Generalized linear mixed models
For notational simplicity, we follow Simpson et al. (2017) and specify our model for a generalized linear mixed model (GLMM), although the ideas presented here can generalize to other settings. For observations , let be the response, be the explanatory variables and be the corresponding fixed effects. We standardize the explanatory variables such that each column of has mean zero and variance one. We also assume that there are types of random effects, , where has levels. We let for be membership vectors such that is the level of random effect for observation and where mixed-membership is excluded. The fixed and random effects prior distributions are assumed to be independent and are related to the response via the linear predictor
| (1) |
where is the intercept. The responses are assumed to be conditionally independent given the linear predictor and follow density function , where is an additional parameter in the likelihood function (see examples below).
The model for the fixed and random effects is and where controls the overall variance of the linear predictor (not the response) and satisfy and apportion the variance to the different model components. Thus, may be interpreted as the total amount of variation in the fixed and random effects, or as a transformation of the total variation of the mean function. In the latter case, the interpretation depends on the link function. Moreover, large values of encode a model with greater flexibility since large variance in the mean function means that the model can capture more trends in the data. In the limit as conversely, we are reduced to the intercept-only model. This interpretation will be important later in this work when we treat the placement of a large prior mass on near zero as “penalizing” towards the null (intercept-only) model. Additionally, notice that the fixed and random effects are modeled similarly, i.e., with a random variance. Even so, we maintain their differing interpretations. Specifically, if we are interested in effect estimates themselves, then we treat this effect as “fixed,” but if our interest lies in the underlying population of the effect, then it is treated as “random” (Searle et al., 2009). Following this interpretation, we are most interested in the estimates of and for .
The prior distribution of relies on the distribution of . For the majority of this work, we assume
| (2) |
We derive this result in the Supplemental Materials whether is treated as fixed or random. If we treat as random, then will be approximately normal for moderate by the Central Limit Theorem. On the other hand, if we consider conditional on , then the distribution of is exactly normal where the variance is different for each but the average variance is due to standardization. For either case, we stress that the prior distribution of is independent of the explanatory variables, resulting in a prior that does not depend on , similar to the PC prior (Simpson et al., 2017). Alternative distributions are discussed in Sections 3.2.2 - 3.2.3 but the normality of is assumed for all experiments.
2.1. Variance decomposition of the linear predictor
The variance parameters determine the relative variance of each component of the model and are restricted to sum to one. These parameters could be fixed, or given prior distributions to add flexibility to the variance decomposition. In the most general case we can assign these parameters a Dirichlet distribution, . Often times we will take . The concentration parameter controls the variation of the prior distribution with large encouraging all the variance components to be roughly equal to , and small reflecting prior uncertainty in the variance components. In some cases, the effects will be grouped and the variance across groups will be decomposed using a Dirichlet prior, e.g., all fixed effects assumed to have the same variance. These ideas are illustrated through examples below.
2.2. Examples
To help fix ideas, we present a few specific examples of this prior construction.
Example 1: Gaussian linear regression model:
In the linear regression setting with no random effects, the linear predictor is simply
and we have so that is the error variance. We then take for . Zhang et al. (2022) study the theoretical properties of this approach for various prior distributions on and . In general, this is a global-local shrinkage prior which has been studied in various contexts (e.g., Carvalho et al., 2010; Polson and Scott, 2012; Polson et al., 2012; Bhattacharya et al., 2015; Zhang and Bondell, 2018).
Example 2: Poisson regression with two-way random effects:
For a mixed effects model with two-way (non-interacting) random effects, the linear predictor is
and . The membership vectors and indicate the level assigned to observation for random effects type one and two, respectively. The variance weights given to the fixed and random effects are determined by the Dirichlet parameter . For example, to allow each fixed effect to have a different variance, we might take where are fixed hyperparameters; on the other hand, for each fixed effect to have the same variance, we might take and then let for and for .
Example 3: Weibull model:
Survival analysis often uses a Weibull model. For simplicity, we consider uncensored data but this could be extended to censored data. Let there be a single random effect so that the linear predictor is
for membership vector . If is the survival time, then the model is for shape parameter . If we assume that the fixed effects have equal variance, then and where .
Example 4: Generalized linear regression with spatial random effects:
Consider the scenario where we observe data from spatial clusters (e.g., cities or villages) at spatial locations . Then let be the response from location where is the cluster indicator. Spatial generalized linear models account for correlation between observations at nearby locations by adding spatially-correlated random effects (e.g., Diggle et al., 1998). Let be the Gaussian random effect for cluster . The linear predictor is then . A stationary and isotropic model assumes and for all and , where is a spatial correlation function such as the exponential function and is the distance between locations and . The covariance structure of the model is determined by the correlation matrix with () element . The spatial regression model is then in the form of (1) where and . While the covariance matrix of the random effect is no longer diagonal, the derivation of (2) still holds as the different random effect levels have the same variance and the covariance terms do not appear in the derivation.
Example 5: Generalized additive model:
Non-linear regression models can also be written as (1). Assume that explanatory variables, , are allowed to have a non-linear relationship with the response variable. The generalized additive model (e.g., Hastie, 2017; Klein et al., 2021) is
for unknown functions . A common approach is to model the using a basis expansion
where are basis function, e.g., spline functions and are “grouped” fixed effects. This model then fits (1) with where is such that , and . Then for and such that determines the proportion of the variance allocated to the non-linear effect of .
3. Variance Decomposition and the R2D2 prior
Gelman et al. (2019), Gelman and Hill (2006) and Zhang et al. (2022) propose measures of model complexity that we name the Variance Decomposition (VaDeR). For the GLMM in Section 2, define and which relates the linear predictor to the response distribution. Gelman et al. (2019) use the empirical definition of , defined as
| (3) |
where M and V are the sample mean and variance operators, respectively.
In (3), is the variance of the expectation of future data and is the expected variance of future residuals, both conditioned on the explanatory variables, membership vectors and fixed and random effects. Because of this conditioning, Gelman et al. (2019) propose as an a posteriori measure of model fit. In principle, however, if the values of and are known but we had yet to observe the responses , then the prior distributions of the fixed and random effects would induce a prior distribution on . Then is the proportion of variance explained by the model for future data, conditioned on these variables and our prior information for and .
While is an intuitive measure of the fit of the model to a particular dataset, for the purpose of setting prior distributions we follow Zhang et al. (2022). We measure complexity at the population level and use the marginal version of that averages over variation in both the explanatory variables and random effect levels ( and ) as well as parameters ( and ). The marginal distribution does not depend on or so the observations are exchangeable. We can then drop the subscript distinguishing them and consider the model for an arbitrary observation with , and as in (2). Then becomes
| (4) |
where and are summaries of the distribution of and thus depend on parameters and . For the sake of simplicity, we suppress the dependence on () and write for the remainder of the paper. The Supplemental Materials discusses the relationship between and and shows that under general conditions, will converge to when both the sample size and number of effective parameters increase. We also include a brief discussion comparing and with other measures of model fit for GLMMs (e.g. Cox and Snell, 1989; McFadden, 1973). Moreover, we note that the coefficient of determination is not commonly used for GLMMs as a measure of model fit. This could be for several reasons, not least of which being that it is difficult to define and interpret a principled for logistic regression, poisson regression, etc. A major advantage of and is that they can easily be extended to GLMMs, while also having intuitive interpretations.
As denoted in (4), the prior distribution of is determined by the joint prior (). For Gaussian responses the distribution of is invariant to , and so to reduce the problem to matching univariate distributions, we parameterize the prior for () as the conditional prior for and marginal prior for . We then select a prior for so that . By construction, since conditioned on any , also follows a marginally over the joint prior for () for any marginal prior . Combined with the Dirichlet prior distribution on the variance proportions, this defines the Dirichlet decomposition prior (R2D2).
The prior for is our default choice, but in some cases the support of can be restricted to a subspace of and a modification is required. Typically, when we also have and thus assuming the distribution of is not degenerate, i.e., . If, however, when , then the lower bound of , , is strictly greater than zero (e.g. Poisson regression with offsets in Supplemental Material). Conversely, for some link functions, for all (e.g., the zero-inflated Poisson model in Supplemental Materials). In general, the upper bound of , , is 1 if and only if as . In cases where and/or , we use a prior distribution for the shifted and scaled , denoted . This is equivalent to using a four-parameter beta distribution for the prior where has density function
In most cases, and so unless otherwise noted we simply denote the prior as .
3.1. Special cases with exact expressions
Below we derive the expressions for the prior distribution for in several special cases where the exact prior distribution is available.
Location-scale models:
The location-scale model is , where the errors have mean zero and variance one. Then and and thus . Assuming follows a and (or more generally that appears in the prior variance, ), Zhang et al. (2022) show that the induced prior on is a Beta Prime distribution, denoted with density function
| (5) |
where denotes the Beta function. In the left panel of Figure 1, we plot for various values of and , and we can see that the BP prior distribution for has heavier tails when the expected is large () versus small ().
Figure 1:
Plot of the prior distribution of to induce with . The title of each panel corresponds to the response model. The normal case takes .
For , and not included in the prior variance, i.e., , the induced prior distribution for is a Generalized Beta Prime (GBP) distribution, . The GBP distribution can be obtained via a transformation of a BP random variable, i.e., if then and has density function
| (6) |
for . The GBP reduces to the BP if .
We note a few properties of the GBP distribution. The behavior at the origin is controlled by the value of , with
The tail behaviour is controlled by with valid mean if only if . Also, for any model with for the overall variance, then the standard deviation has prior distribution . As another special case of the GBP, if , , and , then is distributed as a half- distribution with degrees of freedom and scale . Specifically, if , then follows a half-Cauchy distribution with scale as in Gelman (2006).
Poisson regression:
The Poisson regression model is and thus . Since , , and thus
| (7) |
induces (see Supplemental Materials) the prior for with density
| (8) |
We plot this distribution in Figure 1 and show that shape of the prior looks very similar to that of the location-scale case. We do note, however, that the prior for has exponential-decaying tails on the scale of as seen in (8). But, on the scale of , which is the same scale as and , the prior has polynomial-decaying tails. The value of the prior at 0 is if , if and 0 if .
In the Supplemental Materials, we also include the exact prior distributions for: Poisson with offsets, negative binomial, zero-inflated Poisson, and the Weibull model.
3.2. Approximate Methods
In some cases, e.g., logistic regression, a closed-form expression for VaDeR is not available, so in this section we discuss alternatives.
3.2.1. Linear approximation
The two components we must compute for VaDeR are and . The simplest approach to approximate these is with a linear approximation. Applying a first-order Taylor series approximation of and around gives
| (9) |
Then denoting we have
| (10) |
If , the resulting prior for is . This result does not require any distributional assumptions about other than a finite mean and variance after transformation by and . Additionally, the computational burden is essentially zero.
3.2.2. Quasi-Monte Carlo (QMC)
As we will show, in many cases the linear approximation dose a poor job approximation the true distribution. Therefore, we must turn to other methods. Since finding reduces to computing complicated integrals, we can use integral approximation techniques, like quasi-Monte Carlo (QMC; e.g., Morokoff and Caflisch, 1995). In usual Monte Carlo integration, the integral of interest is approximated by summing over a randomly generated sample of points. QMC is similar except that the points are selected deterministically. To construct the R2D2 prior, we approximate
| (11) |
and
| (12) |
where is the quantile of a standard normal distribution and . This gives an approximation of for a given and , which we denote by
| (13) |
Assuming , then the prior for is
| (14) |
Since this cannot be represented with elementary operations, in practice, we take a numerical derivative to evaluate the prior at a given value, and the entire calculation is completed virtually immediately.
The results in (11) and (12) make use of the normality of from (2). The QMC procedure can be modified to account for non-normal . Let for distribution function . Then we approximate
where is the quantile of . A similar result holds for approximating which then leads to an analogous result to (13). In practice, can be derived analytically if the distribution of is known. A more general strategy is to average over the empirical distribution of giving a mixture of normal distributions for .
3.2.3. Generalized beta prime approximation
The GBP distribution provides an exact solution for the location-scale model in Section 3.1, and an approximate solution for the linear approximation in Section 3.2.1. The prior also induces the exact prior distribution for any model with link functions and . The GBP will not give an exact solution in all cases, but it is a flexible four-parameter model which may often provide a reasonable approximation. Therefore, a general approximation strategy is to find the values of () so that the prior gives an approximate distribution for .
The optimal values of () depend on and as well as , and . For given link functions and parameters, let be the distribution that gives exactly . The GBP parameters are then set to minimize the Pearson -divergence (Rényi, 1961) between the true and approximated PDFs since this metric enforces a close fit at both the origin and in the tails. We found that minimizing this quantity alone, however, led to unstable solutions, i.e., the surface being maximized over is “flat.” This means that vastly different values of () may lead to GBP distributions that yield roughly the same approximation of . Thus, we also add a regularization term to shrink the prior towards a distribution. We regularize toward this distribution because it gives the exact solution in the location-scale case and can be considered the baseline distribution. This results in the following optimization problem:
| (15) |
where is a tuning parameter. A larger value of yields a more stable solution but with a worse fit whereas a smaller value of yields a better fit but with more instability. We found that gives a good balance between fit and stability. In practice, the integral is approximated by a sum and is approximated using QMC as in Section 3.2.2, if necessary. Since the GBP approximation may depend on the QMC procedure which can be modified to allow for non-normality in , the GBP approach can similarly be adapted to allow for any distribution of .
A major advantage of the GBP prior is that it can be easily implemented in standard Bayesian software such as JAGS (Plummer et al., 2016) or Stan (Carpenter et al., 2017). Because the exact prior distributions found in Section 3.1, as well as the resulting distributions from the QMC procedure in Section 3.2.2 do not easily allow for Gibbs sampling, these priors would be difficult for a practitioner to implement. By finding the GBP approximation, however, the R2D2 prior can be easily coded in JAGS and Stan. Example code is available as a vignette in our R package on GitHub. To specify the prior in these packages, we use the relationship that if and , then . Because of these features, we recommend this method for general use even in cases when the exact expression is available, and will be the method we consider in the simulation studies.
Since the GBP approximation depends on (and ), this approximation should be updated with the unknown parameter . The calculation in (15) takes about half a second, however, so this would be overly time prohibitive to compute during every MCMC iteration. Instead, we find the GBP approximation once at the beginning of the analysis at for link function . Thus, to induce , the first step is to find () as in (15) at (and , if necessary, the maximum likelihood estimate of the dispersion parameter). After determining (), (and ) are treated as unknown parameters in the subsequent Bayesian analysis. In the Supplemental Materials, we report the GBP approximations for various values of () and different models. In most cases, the best fitting and values are not close to () which demonstrates the need for this approximation.
Figure 2 compares the linear and GBP approximations with the true distribution for the Poisson model (Section 3.1). The GBP is nearly a perfect match to the true distribution for each prior. The linear approximation is reasonable when , but very poor when . This example shows that the GBP is a very good approximation to the true prior distribution of .
Figure 2:
Comparison of different approximation methods for the Poisson regression model with . The title of each pane indicates the induced prior distribution on .
In the Supplemental Materials, we conduct a simulation study to compare the R2D2 prior with a standard vague prior, the Horseshoe prior (Carvalho et al., 2009), and the PC prior (Simpson et al., 2017) while also comparing different combinations of () . The proposed method performs favorably across all settings and particularly well in the high-dimensional regression setting. Indeed, we empirically find that prior distributions with large prior mass near yield good shrinkage properties.
4. Real data analysis
The proposed method is now applied to two real-world data sets. The first analysis is focused on inference, while the second looks at prediction in the high-dimensional setting.
4.1. Malaria data
We now analyze the gambia data set (Thomson et al., 1999) from the geoR package (Ribeiro Jr et al., 2007) in R to demonstrate the use of the R2D2 prior in practice. We also consider PC and vague prior distributions. There are children in this data set with binary response variable which equals 1 if child tested positive for malaria and 0 otherwise. There are explanatory variables including age, indicator of using a bed net, indicator of whether the bed net is treated, “greenness” of village and indicator of a health center in the area. These variables are standardized to have mean zero and variance one. There are also the villages where each child lived, along with the spatial location of each village.
We model the village effect as a spatial random effect. As in Example 4 from Section 2.2, the linear predictor is
| (16) |
where is the village of response . We also assume that and for all and exponential spatial correlation where is the distance between village and and is the spatial range parameter. Then the full prior specification for R2D2 is
| (17) |
for hyper-parameters set to , , and is the maximum distance between pairs of villages. Note that in this model. We find and () are in Table 1 and the resulting prior distributions are plotted in Figure 3.
Table 1:
Generalized Beta Prime approximation parameters for Gambia data with .
| 1 | 4 | 1.15 | 2.08 | 0.91 | 2.09 |
| 0.5 | 0.5 | 0.57 | 0.29 | 0.90 | 1.54 |
| 1 | 1 | 1.47 | 0.65 | 0.79 | 1.67 |
| 4 | 4 | 7.45 | 2.72 | 0.73 | 1.63 |
| 4 | 1 | 7.77 | 0.71 | 0.68 | 1.45 |
Figure 3:
Prior and global variance parameter for R2D2 prior for Gambia data
For PC prior, the full prior specification is
| (18) |
where and . The vague prior has the same form as the PC prior except (Spiegelhalter et al., 2003).
We take 105,000 MCMC samples with the first 5,000 discarded as burn-in, where the analysis is performed in JAGS. The results are in Figure 4 and Table 2. We also present trace plots in the Supplemental Materials to check convergence of the MCMC chain, as well as the effective sample size and computation time. We can see that the posterior distributions of are very similar across the different methods. The posterior of , however, varies across the different R2D2 priors with the Beta(4,1) and Beta(4,4) having the greatest mean and Beta(0.5,0.5) and Beta(1,1) having the smallest mean. The posterior distributions of and are almost identical for the R2D2 priors which means that the vast majority of the global variance mass is shifted on the random effect variance and away from the fixed effect variance. The posterior for has the smallest mean for the PC prior, which follows from the fact that this prior shrinks the spatial variance toward zero. Lastly, the posterior of varies across the different priors with the PC prior also yielding the smallest posterior mean.
Figure 4:
Posterior , global variance and random effect variance and for vague (uninformative) prior distributions, PC and R2D2 for Gambia data with village spatial random effect.
Table 2:
Posterior mean and standard deviation for , global variance (), random effect variance () and spatial range () for each method for Gambia data considering spatial random effect.
| Method | Mean | St. Dev | Mean | St. Dev | Mean | St. Dev | Mean | St. Dev |
|---|---|---|---|---|---|---|---|---|
| Vague | 0.176 | 0.016 | – | – | 2.389 | 1.397 | 0.851 | 0.500 |
| PC | 0.173 | 0.016 | – | – | 1.210 | 0.515 | 0.427 | 0.270 |
| 0.171 | 0.015 | 1.538 | 0.827 | 1.511 | 0.824 | 0.549 | 0.388 | |
| 0.173 | 0.016 | 2.023 | 1.148 | 1.992 | 1.143 | 0.722 | 0.465 | |
| 0.171 | 0.016 | 1.540 | 0.796 | 1.513 | 0.792 | 0.556 | 0.382 | |
| 0.175 | 0.016 | 2.813 | 1.412 | 2.780 | 1.409 | 0.977 | 0.488 | |
| 0.174 | 0.016 | 2.675 | 1.237 | 2.637 | 1.227 | 0.981 | 0.479 | |
4.2. Genomics data
For our second data analysis, we apply the proposed method to high-dimensional genomics data from human breast tumors (Perou et al., 2000) in the mixOmics R package (Rohart et al., 2017). This data was pre-processed in Pérez-Enciso and Tenenhaus (2003) such that the response, , is 1 if tumor specimen was analyzed before chemotherapy treatment, and 0 if it was analyzed after chemotherapy, for sample where . There are gene expressions as predictor variables, so , and we imputed the appropriate column mean of for any missing values. We consider the R2D2 prior with , and compare with the Horseshoe prior. We choose these hyper-parameter combinations because we hypothesize that prior distributions with large mass near are useful in high-dimensional contexts.
Since our focus of this analysis is prediction, we randomly split the data into train and test sets, where 75% of the data is used for training, and 25% for testing. The model is fit on the training data, and we compute the Brier Score (BS) and binary cross entropy (BCE) loss on the hold-out test data. If is the true response, and is the predicted response, then and . We compute where and are the posterior means of and , respectively, and are the predictor variables for the th test data. The splitting procedure is repeated 50 times and we find the average of each metric. A good method will have small BS and BCE. The analysis was performed in Stan where we computed 10,000 MCMC samples with an additional 1000 for burn-in.
The results are in Table 3. In the Supplemental Materials, we also report the computation time, and average effective sample size for and the global variance parameter. We can see that the R2D2 prior with and Horseshoe perform the best, with smallest BCE and BS, respectively. Indeed, there is a clear trend that the R2D2 priors with more mass near yield better predictions. However, there appears to be diminishing returns beyond .
Table 3:
Prediction results for genomics data with standard error in parentheses. BS is Brier Score, and BCE is the binary cross entropy loss. Best results are labeled in bold.
| Method | BS | BCE |
|---|---|---|
| Horseshoe | 0.23 (0.01) | 0.79 (0.07) |
| 0.29 (0.01) | 0.89 (0.06) | |
| 0.26 (0.00) | 0.71 (0.01) | |
| 0.26 (0.00) | 0.70 (0.01) | |
| 0.26 (0.00) | 0.71 (0.01) |
5. Discussion
In this work, we proposed a novel method for choosing informative prior distributions in the generalized linear mixed model setting. The proposed prior is flexible and interpretable in terms of overall model fit as measured by a Bayesian . There are many cases where the prior can be induced exactly as well as general approximation strategies when an exact form is not possible. The main approach that we suggest is approximating the global variance prior with a generalized beta prime distribution because of its flexibility and ability to be implemented in standard software. Combined with an initial estimate of the intercept via a method of moments estimator and the GBP approximation in the r2d2glmm package, we provide a simple and intuitive method for setting prior distributions in GLMMs.
If there is domain knowledge available on how well the model is expected to fit the data, then this could be used to inform prior choice for . In the absence of any prior information, we suggest as a reasonable default choice. This prior expresses a full range of model fits, but should not be confused with a flat prior for . Choosing for large , or another prior with large mass near 0, is also a good choice, especially when working in a high-dimensional setting. Indeed, substantial prior mass near prevents the model from overfitting by shrinking towards the “base model” of .
The proposed approach naturally fits within the global-local shrinkage prior framework where controls the global shrinkage, and the local shrinkage. Our approach does differ from, e.g., Hamura et al. (2022), who studies shrinkage priors for count data. Using the notation of our paper, Hamura et al. (2022) let where , , and is some offset which may depend on covariates, i.e., . This paper is primarily interested in the prior distribution for the local component () and estimating the rate parameter (). The R2D2 prior, on the other hand, is derived for the global component (), and is focused on estimating the regression components ().
A limitation of the proposed method is that the hierarchical framework only allows for random intercepts and not, for example, random slopes. Additionally, the finite mean and variance requirement precludes applications to some models, e.g., extreme value analysis (Coles et al., 2001). We have also not proven concentration or shrinkage properties which is an avenue for future work. We could also extend the method to allow for other survival analysis settings beyond the uncensored Weibull model and models that are not GLMMs such as Bayesian deep learning. Finally, at present, the method cannot easily be written in INLA (Lindgren and Rue, 2015), so we consider this an important next step.
Supplementary Material
Acknowledgements
The authors thank Brandon Feng for help with the derivation of the Weibull model. We also thank the National Institutes of Health (R01ES031651-01) and King Abdullah University of Science and Technology (3800.2) for financial support.
Footnotes
Supplemental Materials
In the Supplemental Materials, we provide: further discussion and comparison of the different coefficient of determination definitions, additional models and derivations for priors with closed-form expressions, a table showing different values of () for the GBP approximation, a simulation study, and additional results for the real-data analysis.
Disclosures
The authors report there are no competing interests to declare.
References
- Bai R and Ghosh M (2021). On the beta prime prior for scale parameters in high-dimensional bayesian regression models. Statistica Sinica 31(3), 1–23. [Google Scholar]
- Bhadra A, Datta J, Poison NG, and Willard B (2017). The horseshoe+ estimator of ultra-sparse signals. Bayesian Analysis 12(4), 1105–1131. [Google Scholar]
- Bhattacharya A, Pati D, Pillai NS, and Dunson DB (2015). Dirichlet-Laplace priors for optimal shrinkage. Journal of the American Statistical Association 110(512), 1479–1490. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Carpenter B, Gelman A, Hoffman MD, Lee D, Goodrich B, Betancourt M, Brubaker M, Guo J, Li P, and Riddell A (2017). Stan: A probabilistic programming language. Journal of Statistical Software 76(1), 1–32. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Carvalho CM, Poison NG, and Scott JG (2009). Handling sparsity via the horseshoe. In Artificial Intelligence and Statistics, pp. 73–80. PMLR. [Google Scholar]
- Carvalho CM, Polson NG, and Scott JG (2010, 04). The horseshoe estimator for sparse signals. Biometrika 97(2), 465–480. [Google Scholar]
- Coles S, Bawa J, Trenner L, and Dorazio P (2001). An introduction to statistical modeling of extreme values, Volume 208. Springer. [Google Scholar]
- Cox DR and Snell EJ (1989). Analysis of binary data. Chapman & Hall. [Google Scholar]
- Diggle PJ, Tawn JA, and Moyeed RA (1998). Model-based geostatistics. Journal of the Royal Statistical Society: Series C (Applied Statistics) 47(3), 299–350. [Google Scholar]
- Fuglstad G-A, Hem IG, Knight A, Rue H, and Riebler A (2020). Intuitive joint priors for variance parameters. Bayesian Analysis. [Google Scholar]
- Gelman A. (2006). Prior distributions for variance parameters in hierarchical models (comment on article by Browne and Draper). Bayesian Analysis 1(3), 515–534. [Google Scholar]
- Gelman A, Goodrich B, Gabry J, and Vehtari A (2019). R-squared for Bayesian regression models. The American Statistician 73(3), 307–309. [Google Scholar]
- Gelman A and Hill J (2006). Data analysis using regression and multilevel/hierarchical models. Cambridge University Press. [Google Scholar]
- George EI and McCulloch RE (1993). Variable selection via Gibbs sampling. Journal of the American Statistical Association 88(423), 881–889. [Google Scholar]
- Hamura Y, Irie K, and Sugasawa S (2022). On global-local shrinkage priors for count data. Bayesian Analysis 17(2), 545–564. [Google Scholar]
- Hans C. (2009). Bayesian lasso regression. Biometrika 96(4), 835–845. [Google Scholar]
- Hastie TJ (2017). Generalized Additive Models. Routledge. [Google Scholar]
- Hodges JS and Sargent DJ (2001). Counting degrees of freedom in hierarchical and other richly-parameterised models. Biometrika 88(2), 367–379. [Google Scholar]
- Klein N, Carlan M, Kneib T, Lang S, and Wagner H (2021). Bayesian effect selection in structured additive distributional regression models. Bayesian Analysis 16(2), 545–573. [Google Scholar]
- Lewis CM and Knight J (2012). Introduction to genetic association studies. Cold Spring Harbor Protocols 2012(3), pdb–top068163. [DOI] [PubMed] [Google Scholar]
- Lindgren F and Rue H (2015). Bayesian spatial modelling with R-INLA. Journal of statistical software 63(19). [Google Scholar]
- Lindley DV (1957). A statistical paradox. Biometrika 44(1/2), 187–192. [Google Scholar]
- McFadden D. (1973). Conditional logit analysis of qualitative choice behavior. [Google Scholar]
- Morokoff WJ and Caflisch RE (1995). Quasi-Monte Carlo integration. Journal of Computational Physics 122(2), 218–230. [Google Scholar]
- Park T and Casella G (2008). The Bayesian lasso. Journal of the American Statistical Association 103(482), 681–686. [Google Scholar]
- Perez M-E, Pericchi L, and Ramirez I (2017, 09). The scaled Beta2 distribution as a robust prior for scales. Bayesian Analysis 12, 615–637. [Google Scholar]
- Pérez-Enciso M and Tenenhaus M (2003). Prediction of clinical outcome with microarray data: a partial least squares discriminant analysis (pls-da) approach. Human genetics 112, 581–592. [DOI] [PubMed] [Google Scholar]
- Perou CM, Sørlie T, Eisen MB, Van De Rijn M, Jeffrey SS, Rees CA, Pollack JR, Ross DT, Johnsen H, Akslen LA, et al. (2000). Molecular portraits of human breast tumours. nature 406(6797), 747–752. [DOI] [PubMed] [Google Scholar]
- Plummer M, Stukalov A, Denwood M, and Plummer MM (2016). Package ‘rjags’ Vienna, Austria. [Google Scholar]
- Polson NG and Scott JG (2012). On the Half-Cauchy Prior for a Global Scale Parameter. Bayesian Analysis 7(4), 887–902. [Google Scholar]
- Polson NG, Scott JG, Clarke BS, and Severinski C (2012). Shrink globally, act locally Sparse bayesian regularization and prediction. [Google Scholar]
- Rényi A. (1961). On measures of entropy and information. In Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Contributions to the Theory of Statistics, pp. 547–561. University of California Press. [Google Scholar]
- Ribeiro PJ Jr, Diggle PJ, Ribeiro MPJ Jr, and Suggests M (2007). The geoR package. R news 1(2), 14–18. [Google Scholar]
- Ročková V and George EI (2018). The spike-and-slab lasso. Journal of the American Statistical Association 113(521), 431–444. [Google Scholar]
- Rohart F, Gautier B, Singh A, and Lê Cao K-A (2017). mixomics: An r package for ‘omics feature selection and multiple data integration. PLoS computational biology 13(11), e1005752. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Searle SR, Casella G, and McCulloch CE (2009). Variance Components. John Wiley & Sons. [Google Scholar]
- Simpson D, Rue H, Riebler A, Martins TG, Sørbye SH, et al. (2017). Penalising model component complexity: A principled, practical approach to constructing priors. Statistical science 32(1), 1–28. [Google Scholar]
- Spiegelhalter D, Thomas A, Best N, and Lunn D (2003). Winbugs user manual. [Google Scholar]
- Thomson MC, Connor SJ, D’Alessandro U, Rowlingson B, Diggle P, Cresswell M, and Greenwood B (1999). Predicting malaria infection in gambian children from satellite data and bed net use surveys: the importance of spatial correlation in the interpretation of results. The American Journal of Tropical Medicine and Hygiene 61(1), 2–8. [DOI] [PubMed] [Google Scholar]
- Zhang Y and Bondell HD (2018). Variable Selection via Penalized Credible Regions with Dirichlet-Laplace Global-Local Shrinkage Priors. Bayesian Analysis 13(3), 823–844. [Google Scholar]
- Zhang YD, Naughton BP, Bondell HD, and Reich BJ (2022). Bayesian regression using a prior on the model fit: The r2-d2 shrinkage prior. Journal of the American Statistical Association 117(538), 862–874. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.




