# NOT RUN {
library(bayestestR)
p_map(rnorm(1000, 0, 1))
p_map(rnorm(1000, 10, 1))
# }
# NOT RUN {
library(rstanarm)
model <- stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
p_map(model)
library(emmeans)
p_map(emtrends(model, ~1, "wt"))
library(brms)
model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
p_map(model)
library(BayesFactor)
bf <- ttestBF(x = rnorm(100, 1, 1))
p_map(bf)
# }
# NOT RUN {
# }
# NOT RUN {
# ---------------------------------------
# Robustness to density estimation method
set.seed(333)
data <- data.frame()
for (iteration in 1:250) {
x <- rnorm(1000, 1, 1)
result <- data.frame(
"Kernel" = p_map(x, method = "kernel"),
"KernSmooth" = p_map(x, method = "KernSmooth"),
"logspline" = p_map(x, method = "logspline")
)
data <- rbind(data, result)
}
data$KernSmooth <- data$Kernel - data$KernSmooth
data$logspline <- data$Kernel - data$logspline
summary(data$KernSmooth)
summary(data$logspline)
boxplot(data[c("KernSmooth", "logspline")])
# }
Run the code above in your browser using DataLab