베이지안과 빈도주의 접근법 비교

rstanarm으로 배우는 Bayesian 회귀 모델링

Jake Thompson

Psychometrician, ATLAS, University of Kansas

동일한 매개변수!

tidy(lm_model)
         term   estimate  std.error statistic      p.value
1 (Intercept) 25.7997778 5.91741208  4.359977 1.627847e-05
2      mom_iq  0.6099746 0.05852092 10.423188 7.661950e-23
tidy(stan_model)
        term   estimate  std.error
1 (Intercept) 25.7257965 6.01262625
2      mom_iq  0.6110254 0.05917996
rstanarm으로 배우는 Bayesian 회귀 모델링

빈도주의 vs. 베이지안

  • 빈도주의: 매개변수는 고정, 데이터는 확률적
  • 베이지안: 매개변수는 확률적, 데이터는 고정
  • p-값이란?
    • 귀무가설 하에서 검정 통계량의 확률
  • 베이지안이 원하는 것은?
    • 관측 데이터가 주어졌을 때 매개변수 값의 확률
rstanarm으로 배우는 Bayesian 회귀 모델링

베이지안 매개변수 평가

  • 신뢰 구간: 범위가 참값을 포함할 확률
    • 범위가 참값을 포함할 확률이 90%
  • 신용 구간: 참값이 범위 내에 있을 확률
    • 참값이 이 범위 내에 있을 확률이 90%
  • 매개변수 값의 확률 vs. 범위 경계의 확률
rstanarm으로 배우는 Bayesian 회귀 모델링

신용 구간 생성

posterior_interval(stan_model)
                    5%        95%
(Intercept) 16.1396617 35.6015948
mom_iq       0.5131289  0.7042666
sigma       17.2868651 19.3411104
posterior_interval(stan_model, prob = 0.95)
                  2.5%      97.5%
(Intercept) 14.5472824 37.2505664
mom_iq       0.4963677  0.7215823
sigma       17.1197930 19.5359616
posterior_interval(stan_model, prob = 0.5)
                   25%        75%
(Intercept) 21.7634032 29.6542886
mom_iq       0.5714405  0.6496865
sigma       17.8776965 18.7218373
rstanarm으로 배우는 Bayesian 회귀 모델링

신뢰 구간 vs. 신용 구간

confint(lm_model, parm = "mom_iq", level = 0.95)
           2.5 %    97.5 %
mom_iq 0.4949534 0.7249957
stan_model <- stan_glm(kid_score ~ mom_iq, 
                       data = kidiq)
posterior_interval(stan_model, 
                   pars = "mom_iq", 
                   prob = 0.95)
             2.5%     97.5%
mom_iq 0.4963677  0.7215823
posterior <- spread_draws(stan_model, mom_iq) 
mean(between(posterior_mom_iq, 0.60, 0.65))
0.31475
rstanarm으로 배우는 Bayesian 회귀 모델링

연습해 봅시다!

rstanarm으로 배우는 Bayesian 회귀 모델링

Preparing Video For Download...