調整估計流程

使用 rstanarm 的貝葉斯迴歸建模

Jake Thompson

Psychometrician, ATLAS, University of Kansas

發散轉換(Divergent transitions)

1: There were 15 divergent transitions after warmup. Increasing adapt_delta
above 0.8 may help. 
  • 估計器步伐過大
  • 調整步長大小
stan_model <- stan_glm(popularity ~ song_age, data = songs,
  control = list(adapt_delta = 0.95))
stan_model <- stan_glm(popularity ~ song_age, data = songs,
  control = list(adapt_delta = 0.99))
使用 rstanarm 的貝葉斯迴歸建模

超過最大樹深(Maximum Treedepth)

Chain 1 reached the maximum tree depth
  • 取樣會探索分支並尋找合適的「U-Turn」位置
  • 達到最大樹深代表效率不佳
stan_model <- stan_glm(popularity ~ song_age, data = songs,
  control = list(max_treedepth = 10))
stan_model <- stan_glm(popularity ~ song_age, data = songs,
  control = list(max_treedepth = 15))
使用 rstanarm 的貝葉斯迴歸建模

調校估計

  • 估計誤差會威脅模型的有效性
  • 雖然機制複雜,但這些誤差能輕鬆處理
使用 rstanarm 的貝葉斯迴歸建模

一起來練習吧!

使用 rstanarm 的貝葉斯迴歸建模

Preparing Video For Download...