Extending the model
rain_model_2 <- stan_glm(
raintomorrow ~ humidity9am + humidity3pm + raintoday,
data = weather, family = binomial,
prior_intercept = normal(-1.4, 0.7),
prior = normal(0, 2.5, autoscale = TRUE),
chains = 4, iter = 5000*2, seed = 84735)
# Obtain prior model specifications
prior_summary(rain_model_2)
set.seed(84735)
cv_accuracy_2 <- classification_summary_cv(
model = rain_model_2, data = weather, cutoff = 0.2, k = 10)
# Calculate ELPD for the models
loo_1 <- loo(rain_model_1)
loo_2 <- loo(rain_model_2)
# Compare the ELPD for the 2 models
loo_compare(loo_1, loo_2)
## elpd_diff se_diff
## rain_model_2 0.0 0.0
## rain_model_1 -80.2 13.5