if (FALSE) {
# build a greta model
n <- 10
y <- rnorm(n)
y <- as_data(y)
library(greta)
sd <- lognormal(1, 2)
mu <- normal(0, 1, dim = n)
distribution(y) <- normal(mu, sd)
m <- model(mu, sd)
# simulate one random draw of y, mu and sd from the model prior:
sims <- simulate(m)
# 100 simulations of y, mu and sd
sims <- simulate(m, nsim = 100)
}
# nolint start
Run the code above in your browser using DataLab