You’re getting the error about the prior because you currently haven’t specified any population-level parameters (“fixed effects”) in your formula, but in your call to brm you specify a prior for a (non-existing) population-level parameter (class = b). Your formula currently only contains group-level parameters (“random effects”), which corresponds to the prior class = sd. This is what the get_prior output is telling you: If you look at the class column, it only contains a population-level intercept, group-level parameters, and noise variance sigma.
I don’t know the details of your data and model, but perhaps you also want to specify population-level parameters? For example, something like: f <- bf(y ~ state * day + (1 + day | state))
When it says class = sd, I was assuming from the documentation that it’s only setting a prior for the standard deviation, rather than the group level coefficient mean value. Is that true? If so, does that mean there’s no way to set priors for mean of group level parameters?
Thanks for the recommendation bf(y ~ state * day + (1 + day | state)). That would also make sense for my model.
The group-level parameters are assumed to come from a multivariate normal distribution with mean = 0 and unknown covariance matrix. This covariance matrix is modelled as a parameter; this is why you can specify priors on the SD parameters (see the brms paper for more details).
Because the mean is zero, you can think of the group-level parameters as “adjustments” to the corresponding population-level parameter. Thus, if I’m not mistaken, you can consider the population-level coefficient as the mean of the corresponding group-level parameters. You can obviously specify a prior on that population-level coefficient, as you already did in your original post.