# # data
# df <- as_tibble(rnorm(100, 5, 3))
# # formula
# f <- bf(value ~ 1)
# make_stancode(f, data = df)Prior predictive checks
Checking my understanding of prior predictive checks and the Wiener process model
Very simple toy model: y ~ N(mu, sigma).
Prior Predictive Checks
- source: https://mc-stan.org/docs/stan-users-guide/posterior-predictive-checks.html#prior-predictive-checks
Let’s assume mu ~ N(4, 2) and sigma ~ N(3, 1):
# # Define the data
# N <- 100
# my_x <- rnorm(N, 0, 1)
#
# stan_data <- list(
# N = N,
# x = my_x
# )
#
# model <- cmdstan_model("ex1.stan")Fit the stan model:
# fit1 <- model$sample(
# data = stan_data,
# chains = 4,
# fixed_param = TRUE,
# iter_warmup = 0,
# iter_sampling = 1000,
# refresh = 0
# )# fit1$draws("y_sim") %>% as_draws_df(.) %>%
# select(1) # %>%
# ggplot(aes(x = `y_sim[1]`)) # +
# geom_slab()Prior predictive check with a Weiner process model
# TODO