if (FALSE) { # require("rstanarm") && require("see")
# \donttest{
library(bayestestR)
model <- rstanarm::stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
check_prior(model, method = "gelman")
check_prior(model, method = "lakeland")
# An extreme example where both methods diverge:
model <- rstanarm::stan_glm(mpg ~ wt,
data = mtcars[1:3, ],
prior = normal(-3.3, 1, FALSE),
prior_intercept = normal(0, 1000, FALSE),
refresh = 0
)
check_prior(model, method = "gelman")
check_prior(model, method = "lakeland")
# can provide visual confirmation to the Lakeland method
plot(si(model, verbose = FALSE))
# }
}
Run the code above in your browser using DataLab