預測分數分佈
現在來練習使用後驗預測分數,看看我們的 Spotify 模型與真實資料的貼合程度。
本練習屬於課程
使用 rstanarm 的貝葉斯迴歸建模
練習說明
- 計算
stan_model的後驗預測分數 - 列印
songs資料中觀察到的熱門度分數摘要 - 與第 1 與第 10 次複製的摘要進行比較
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate posterior predictive scores
predictions <- ___(stan_model)
# Print a summary of the observed data
summary(songs$___)
# Print a summary of the 1st replication
summary(predictions[___,])
# Print a summary of the 10th replication
summary(predictions[___,])