Muk*_*ati 6 regression r bayesian rstanarm
Suppose I have a following formula for a mixed effects model:
Performance ~ 1 + WorkingHours + Tenure + (1 + WorkingHours + Tenure || JobClass)
Run Code Online (Sandbox Code Playgroud)
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)
Run Code Online (Sandbox Code Playgroud)
But how do I specify the priors for random slopes and intercept using
prior_covariance = decov(regularization, concentration, shape, scale)
Run Code Online (Sandbox Code Playgroud)
(or)
lkj(regularization, scale, df)
Run Code Online (Sandbox Code Playgroud)
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.
由于您使用的是贝叶斯模型,因此您不会指定相关性或方差。您将通过给出一些参数的值来指定协方差矩阵的似然分布(通过相关矩阵和方差向量)。
该regularization参数是一个正实值,决定事物相关的可能性。值 1 相当于“一切皆有可能”选项(这是默认值)。值大于 1 意味着您认为相关性(如果有的话)很少。值小于 1 意味着您认为存在很多相关性。
该scale参数与方差之和相关。特别地,尺度参数等于平均方差的平方根。
该concentration参数用于控制总方差在不同变量之间的分布。值为 1 表示您没有期望。较大的值表示您认为变量在总方差中具有相似的比例。0 到 1 之间的值意味着您认为存在不同的贡献。
该shape参数用于充当 的先验的 Gamma 分布scale。
最后,df是你先前的自由度。
因此,decov和lkj都为您提供了一种不同的方式来表达您对协方差矩阵属性的期望,但它们不会让您指定您认为哪些特定变量与其他特定变量相关。它应该决定作为模型拟合过程的一部分。
这全部来自rstanarm 文档
| 归档时间: |
|
| 查看次数: |
204 次 |
| 最近记录: |