開始使用免費開始

調整估計設定

現在來調整估計選項,讓你能預先準備並處理可能出現的錯誤。當錯誤發生時,及早解決很重要,這樣才能確保推論是有效的。songs 資料已載入。

本練習屬於課程

使用 rstanarm 的貝葉斯迴歸建模

檢視課程

練習說明

  • 估計兩個模型,以 song_age 預測 popularity
  • 在第一個模型中,將 adapt_delta 設為 0.99
  • 在第二個模型中,將 max_treedepth 設為 15
  • 檢視每個模型的摘要

動手互動練習

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

# Estimate the model with a new `adapt_delta`
adapt_model <- ___(popularity ~ song_age, data = songs,
  ___ = list(___ = ___))

# View summary
___(adapt_model)

# Estimate the model with a new `max_treedepth`
tree_model <- ___(popularity ~ song_age, data = songs,
  ___ = list(___ = ___))

# View summary
___(tree_model)
編輯並執行程式碼