Help selecting Gamma priors (for multivariate mixture model)

Please also provide the following information in addition to your question:

  • Operating System: Windows 8
  • brms Version: 2.4.0

I’m attempting to set up a multivariate gamma mixture model to model interval data from my research (building from someone’s dissertation - the gamma mixture is the most appropriate for our data).

However, I’m quite new to modeling in general and unfamiliar with Gamma distributions. I’m having trouble figuring out appropriate priors to set for my model.

My priors/model so far (I have a lot more parameters to add in, but can’t get this run yet):

prior1 <- c(set_prior(“gamma(0.1, 1)”, class=“shape1”),
set_prior(“gamma(5, 10)”, class = “shape2”))

fit1 <- brm(brmsformula(
intervals ~ 1 + mating_success,
theta2 ~ 1 + mating_success),
data = intervals,
family = mixture(Gamma, Gamma),
control=list(adapt_delta = 0.99),
prior = prior1,
warmup = 100, iter = 1000, chains = 1)

I have a few questions:
(1) When I run this, as is, I get the following error: “Rejecting initial value:
Error evaluating the log probability at the initial value.” 20-40 times, and then this output: "Initialization between (-2, 2) failed after 100 attempts.
Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] “Error in sampler$call_sampler(args_list[[i]]) : Initialization failed.”
[2] “In addition: Warning message:”
[3] “Rows containing NAs were excluded from the model. "
[1] “error occurred during calling the sampler; sampling not done””

I have no idea what this error means or how to address it, and have not found resources yet that I understood - any advice or direction to appropriate resources would be appreciated!

(2) When looking at “get_prior” for my model, I’m fairly confused at the output:
a) what is class “b”?
b) what is being represented by the “dpar” column?

(3) Are the priors I’m setting inappropriate? Should I also be resetting the student_t (or other) priors?

Please bear with my lack of understanding - jumping in head first to modeling with a more complicated model here!
Thank you for any and all advice,

Mixture distributions are often hard to get working. In your case, it’s because the default link of Gamma is “inverse” not “log”, which leads to all sorts of problems (not my fault as Gamma comes from the stats package). I recommend going for mixture(Gamma("log"), Gamma("log")).

1 Like

Thanks, Paul, that minor tweak did get rid of the error in (1) above! The model ran and looks like it mostly converged (Rhat between 1.00 and 1.03 for all parameters).

I’m noticing now some new concerns though:
-I’m getting a few hundred divergent transitions (and adapt_delta is already at 0.99)
-my effective sample sizes are either 1 or 32 (number of observation: 1324) for all parameters
-the lower and upper confidence intervals for all parameters are the same as both the estimate and each other.

Any thoughts? Sorry again if these are fairly basic questions, this is my first time building a model.

That’s just the usual problems with mixture models… ;-)

Perhaps try to fit some non-mixture model first?

You may try to specify some informative priors on your model parameters, but that’s not something easily done in general and also in mixture models.