事後予測チェックによるモデル適合

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