简体   繁体   中英

How to specify random coefficients priors in rstanarm?

Suppose I have a following formula for a mixed effects model:

Performance ~ 1 + WorkingHours + Tenure + (1 + WorkingHours + Tenure || JobClass)

then I can specify priors for fixed slopes and fixed intercept as:

prior = normal(c(mu1,mu2), c(sd1,sd2), autoscale = FALSE)
prior_intercept = normal(mean, scale, autoscale = FALSE)

But how do I specify the priors for random slopes and intercept using

prior_covariance = decov(regularization, concentration, shape, scale)

(or)

lkj(regularization, scale, df)

if I know the variance between the slopes and intercepts and the correlation between them. I am unable to understand how to specify the parameters for the above mixed effects formula.

Because you're working in a Bayesian model, you aren't going to specify the correlations or variances. You're going to specify a likelihood distribution of covariance matrices (by way of the correlation matrix and vector of variances) by giving the values for a few parameters.

The regularization parameter is a positive real value that determines how likely things are to be correlated. A value of 1 is sort of the "anything's possible" option (this is the default). Values greater than 1 mean that you believe there are few, if any, correlations. Values less than 1 mean you believe there is a lot of correlation.

The scale parameter is related to the sum of the variances. In particular, the scale parameter is equal to the square root of the average variance.

The concentration parameter is used to control how the total variance is distributed among the different variables. A value of 1 is saying you don't have an expectation. Larger values say that you believe that the variables have similar proportions of the total variance. Values between 0 and 1 mean that you think there are dissimilar contributions.

The shape parameter is used for a Gamma distribution that acts as a prior on the scale .

Then, finally, df is your prior degrees of freedom.

So, decov and lkj are each giving you a different way to express your expectations about properties of the covariance matrix, but they won't let you specify which specific variables you believe to be correlated with which other specific variables. It should decide that as part of the model fitting process.

This is all from the rstanarm documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM