绘制模型不确定性
由于我们使用了贝叶斯估计,您可以利用后验分布,从后验样本的每一次抽样中生成一条预测回归线。这些线将展示整体回归线周围的不确定性。songs 和 stan_model 对象已加载,同时还包含您在上一个练习中使用的 model_intercept 和 model_slope。
本练习是课程的一部分
使用 rstanarm 进行贝叶斯回归建模
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Save the values from each draw of the posterior distribution
draws <- ___(stan_model, `___`, `___`)
# Print the `draws` data frame to the console
___