指定信息量更高的先验
现在让我们指定一个自定义先验,以便对模型有更多控制。数据集 songs 已经加载。
本练习是课程的一部分
使用 rstanarm 进行贝叶斯回归建模
练习说明
- 用
song_age预测popularity - 为该自变量指定正态先验分布,均值为 20,标准差为 0.1
- 将先验摘要打印到屏幕上
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Estimate the model with an informative prior
inform_prior <- stan_glm(___ ~ ___, data = songs,
___ = normal(___ = 20, ___ = 0.1, autoscale = FALSE))
# Print the prior summary
___(inform_prior)