以後驗預測檢查評估模型擬合度

使用 rstanarm 的貝葉斯迴歸建模

Jake Thompson

Psychometrician, ATLAS, University of Kansas

R 平方的後驗分佈

stan_model <- stan_glm(kid_score ~ mom_iq, data = kidiq)
r2_posterior <- bayes_R2(stan_model)

summary(r2_posterior)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.09677 0.18034 0.20006 0.20042 0.22048 0.33414
quantile(r2_posterior, probs = c(0.025, 0.975))
     2.5%     97.5% 
0.1402846 0.2619605
使用 rstanarm 的貝葉斯迴歸建模

R 平方直方圖

hist(r2_posterior)

使用 rstanarm 的貝葉斯迴歸建模

密度重疊圖

pp_check(stan_model, "dens_overlay")

使用 rstanarm 的貝葉斯迴歸建模

後驗預測檢定

pp_check(stan_model, "stat")

使用 rstanarm 的貝葉斯迴歸建模

後驗預測檢定

pp_check(stan_model, "stat_2d")

使用 rstanarm 的貝葉斯迴歸建模

一起來練習吧!

使用 rstanarm 的貝葉斯迴歸建模

Preparing Video For Download...