if (FALSE) { # require("rstanarm") && require("brms")
# \donttest{
library(bayestestR)
posterior <- rnorm(10000)
map_estimate(posterior)
plot(density(posterior))
abline(v = as.numeric(map_estimate(posterior)), col = "red")
model <- rstanarm::stan_glm(mpg ~ wt + cyl, data = mtcars)
map_estimate(model)
model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
map_estimate(model)
# }
}
Run the code above in your browser using DataLab