计算调整后的尺度
了解 rstanarm 如何为先验分布计算调整后的尺度非常重要,因为如果使用不当,先验会对估计产生很大影响。请使用已加载的 songs 数据,计算应得到的调整后尺度。
本练习是课程的一部分
使用 rstanarm 进行贝叶斯回归建模
练习说明
- 计算截距的调整后尺度。
- 计算
song_age的调整后尺度。 - 如果将
valence纳入模型,它的调整后尺度会是多少?
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Calculate the adjusted scale for the intercept
___ * sd(songs$___)
# Calculate the adjusted scale for `song_age`
(___ / sd(songs$___)) * sd(songs$___)
# Calculate the adjusted scale for `valence`
(___ / sd(songs$___)) * sd(songs$___)