Hello,
I am trying to run the following model in r:
brms::brm(formula = acc ~ cond * run + (cond | subj) + (1 | block),
data = data, family = Gamma(link = "identity"),
warmup = 1000, iter = 10000, chains = 4,
control = list(adapt_delta = 0.99, stepsize = 0.0001, max_treedepth = 30))
Distribution of my data is the following:
So all data are positive and distribution is close to gamma.
When I run it, I get several errors of this kind:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: gamma_lpdf: Inverse scale parameter[13] is -0.0240896, but must be positive finite! (in 'anon_model', line 86, column 4 to column 49)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: gamma_lpdf: Inverse scale parameter[39] is -7.9367, but must be positive finite! (in 'anon_model', line 86, column 4 to column 49)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: gamma_lpdf: Inverse scale parameter[1] is -0.849606, but must be positive finite! (in 'anon_model', line 86, column 4 to column 49)
...
If I try to run the same model with the log as link function, no errors are popping up.
Do you know why negative initial values are generated when I use the identity link function?
Is this an hint telling me I should use the log?
I don’t have any hypothesis for which the link function should be log.
Thank you very much in advance!
- Operating System: Ubuntu 18.04.5 LTS
- brms Version: ‘2.18.3’