使用后验预测检验评估模型拟合

使用 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...