開始使用免費開始

判定先驗分配

現在來探索貝氏模型的先驗分配,了解 rstanarm 如何處理先驗。先驗會對模型結果產生很大的影響,因此知道在已估計的模型中用了哪些先驗分配很重要。songs 資料集已經載入。

本練習屬於課程

使用 rstanarm 的貝葉斯迴歸建模

檢視課程

練習說明

  • 估計一個以 song_age 預測 popularity 的模型。
  • 在畫面上列印先驗分配的摘要。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Estimate the model
stan_model <- ___(___ ~ ___, data = songs)

# Print a summary of the prior distributions
___(stan_model)
編輯並執行程式碼