R-squared 後驗分佈
首先,來取得 R-squared 統計量的後驗分佈,這樣你就能推論模型的預測能力可能有多好。使用 Spotify 資料的 stan_model 已經載入。
本練習屬於課程
使用 rstanarm 的貝葉斯迴歸建模
練習說明
- 計算 R-squared 統計量的後驗分佈
- 繪製 R-squared 分佈的直方圖
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate the posterior distribution of the R-squared
r2_posterior <- ___(stan_model)
# Make a histogram of the distribution
___(r2_posterior)