Short summary of the problem :
I try to fit tree growth height as a function of tree growth circumference with a non-linear hierarchical model in brms.
acc_h ~ exp(a)(1-exp(-exp(b)*acc_c) with :
acc_h = tree growth height
acc_c = tree growth circumference
a and b the parameter to b estimate
I would like to use a Gamma distribution (growth can’t be negative) and an identity link in order to not change the form of the relation between height growth and circumference growth.
The expectation of mu should always be positive because acc_c>0.
The sampler has trouble finding initial values for the scale parameter and throws the following error multiple times:
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: gamma_lpdf: Inverse scale parameter is inf, but must be finite! (in ‘model1eff7e31495d_93ef33a66d298bf1ece66700bd599138’ at line 85)
nlform_C <- bf(acc_h ~ exp(alpha)*(1-exp(-exp(beta)*acc_c)), alpha ~ 1+ (1|flib_placette/fperiode) , beta ~ 1+(1|flib_placette/fperiode) , nl = TRUE) nlprior_C <- c(prior(normal(4, 2), nlpar = "alpha"), prior(normal(0, 2), nlpar = "beta")) fit_C <- brm(formula = nlform_C, data = arbre_periode3_brassy, prior = nlprior_C, family = Gamma(link="identity"), warmup=1000,iter=1200,chains = 1)
Is there a way to fix this problem ?
Please also provide the following information in addition to your question:
- Operating System: Ubuntu 20
- brms Version: 2.16