How to assign prior distribution for the data in brm() in R

Hello, I first fit a bayesian model by brm() in R. But I found significant difference between observed data and replicated data from the model after using pp_check(model,type = "dens_overlay") . I’m not very familiar with Bayesian frameworks, follow the model prompts, I think the difference is maybe caused by insufficient iteration and deficiency of reliable prior distribution. How did I assign prior distribution for the data to get a more perfect model? Thank you very much!

Here is my data distribution and code:
(data distribution: from -1 to 12)

(R code)

fit_brm_wiggle <- brm(y ~ s(x) ,
                      data = dat_select,
                      family = "exgaussian",
                      chains = 4,
                      iter = 8000,
                      cores = 4,
                      control = list(max_treedepth = 15,adapt_delta=0.9))

There’s some guidance and examples for setting priors in the brms documentation: Prior Definitions for brms Models — set_prior • brms

Thank you very much! I will keep trying.

1 Like