다른 데이터셋으로 모델 적합하기
이항 모형을 비디오 광고 데이터(100명 중 13명 클릭)와 새 텍스트 광고 데이터(100명 중 6명 클릭) 모두에 적합해 보세요.
이 연습은 강의의 일부입니다
R로 배우는 Bayesian 데이터 분석 기초
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Define parameters
n_draws <- 100000
n_ads_shown <- 100
proportion_clicks <- runif(n_draws, min = 0.0, max = 0.2)
n_visitors <- rbinom(n = n_draws, size = n_ads_shown,
prob = proportion_clicks)
prior <- data.frame(proportion_clicks, n_visitors)
# Create the posteriors for video and text ads
posterior_video <- prior[prior$n_visitors == 13, ]
posterior_text <- ___
# Visualize the posteriors
hist(posterior_video$proportion_clicks, xlim = c(0, 0.25))
___