計算調整後尺度
瞭解 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$___)