사용자 지정 사전 분포

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

Jake Thompson

Psychometrician, ATLAS, University of Kansas

기본 사전 분포를 변경하는 이유

  • 매개변수가 특정 값을 가질 것이라는 타당한 근거
  • 매개변수에 대한 제약 조건
rstanarm으로 배우는 Bayesian 회귀 모델링

사전 분포 지정

stan_model <- stan_glm(kid_score ~ mom_iq, data = kidiq,
  prior_intercept = normal(location = 0, scale = 10),
  prior = normal(location = 0, scale = 2.5),
  prior_aux = exponential(rate = 1)
)
rstanarm으로 배우는 Bayesian 회귀 모델링

사전 분포 지정

stan_model <- stan_glm(kid_score ~ mom_iq, data = kidiq,
  prior_intercept = normal(location = 0, scale = 10, autoscale = FALSE),
  prior = normal(location = 0, scale = 2.5, autoscale = FALSE),
  prior_aux = exponential(rate = 1, autoscale = FALSE)
)
rstanarm으로 배우는 Bayesian 회귀 모델링

사전 분포 지정

stan_model <- stan_glm(kid_score ~ mom_iq, data = kidiq,
  prior_intercept = normal(location = 3, scale = 2),
  prior = cauchy(location = 0, scale = 1))
  • 다양한 사전 분포
    • normal()
    • exponential()
    • student_t()
    • cauchy()
  • ?priors
rstanarm으로 배우는 Bayesian 회귀 모델링

평탄 사전 분포

stan_model <- stan_glm(kid_score ~ mom_iq, data = kidiq,
  prior_intercept = NULL,
  prior = NULL,
  prior_aux = NULL)
prior_summary(stan_model)
Priors for model 'stan_model' 
 ------
Intercept (after predictors centered)
 ~ flat

Coefficients
 ~ flat

Auxiliary (sigma)
 ~ flat
 ------
See help('prior_summary.stanreg') for more details
rstanarm으로 배우는 Bayesian 회귀 모델링

연습해 봅시다!

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

Preparing Video For Download...