Please also provide the following information in addition to your question:
- Operating System: Mac OS High Sierra v10.13.6
- brms Version: 2.8.0
Hello!
I am somewhat new at all this, so please bear with me, but I recently encountered a problem that I had not seen before.
PROBLEM:
My imputation model continually produces this error message:
Chain 1: Rejecting initial value:
Chain 1: Log probability evaluates to log(0), i.e. negative infinity.
Chain 1: Stan can't start sampling from this initial value.
Chain 1:
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
However, just approximately 1 month ago, this model worked perfectly without this error message.
MODEL
I am doing research on hormones, and because of the problems with collection, there are a few NAs in my data. I decided to impute these values with a similar model to below:
Missing_1 <- bf(log_hormone_1 | mi() ~ weight + age + (1|q|Group) + Species * Sex)
Missing_2 <- bf(log_hormone_2 | mi() ~ weight + age + (1|q|Group) + Species * Sex)
Missing_3 <- bf(log_hormone_3 | mi() ~ weight + age + (1|q|Group) + Species * Sex)
Missing_4 <- bf(log_hormone_4 | mi() ~ weight + age + (1|q|Group) + Species * Sex)
Model_1 <- brm(Missing_1 + Missing_2 + Missing_3 + Missing_4 + set_rescor(TRUE),
data = MyData,
prior = c(
prior(normal(0,2), class="Intercept"),
prior(normal(0,1), class="b"),
prior(cauchy(0,1), class="sd", resp="Missing_1"),
prior(cauchy(0,1), class="sd", resp="Missing_2"),
prior(cauchy(0,1), class="sd", resp="Missing_3"),
prior(cauchy(0,1), class="sd", resp="Missing_4"),
prior(lkj(2), class="cor")),
chains=3, cores=3, warmup=2000, iter=6000,
control = list(max_treedepth = 15, adapt_delta=0.99))
Although this model worked just fine previously, now I get that error message mentioned above.
Oddly enough, this model CAN work now if I remove the residual correlation terms.
I tried alternative formulations such as:
Model_1 <- brm(mvbf(Missing_1, Missing_2, Missing_3, Missing_4, rescor = TRUE)
But this was also unsuccessful.
SUMMARY
I looked around and noticed that the mi() term has been updated within the last month, so I imagine that my problems have begun occurring because of this update.
I am just wondering:
-
Why does the model not work when the residual correlations are included?
-
How should I rephrase my model to make it more compatible to the newer mi() code?
Thank you very much for your time and efforts with brms!