Closed andtheWings closed 1 year ago
Something is being assigned a prior distribution with a negative value for the scale parameter (probably the intercept). That seems like a bug, because it' the default prior; but maybe its possible that there's something wrong with the data. Does the error happen before the prior distributions are printed to the console? Can you see that min(suid$suid_count
, min(suid$under_5_count)
are >=0
?
Yes, I'm not seeing any prior distributions printing to the console before the error. Both variables have zero as their minimums. Here are their distros:
It seems like the error message is indicating it doesn't want there to be any values equal to zero?
if (any(x <= 0))
Ah yeah, the population at risk has to be greater than zero. If there's no population at risk, then there can't be any deaths (or cases). So you can probably just drop those tracts from the analysis.
Mathematically, you'll be adding log(0)=-Inf
to the linear predictor. Or you can think of it as having zero as the denominator in the rate: Expectation[y] = exp(log(pop) + eta) = pop * exp(eta)
can be manipulated to show Expectation[y/pop] = exp(eta)
, which is also defined as y/pop=Inf
.
Make sense? I think it would help if I added a more informative error message there
Ok yes, that makes sense, there was a single tract where the estimated population at risk was zero so I filtered out and the model was able to proceed with fitting/sampling. It looks like the chains did not converge, but that's a separate issue so I'll close out this issue. Thanks for the help!
I have the following data:
I tried to fit a poisson car model on it and got the following error:
And the traceback:
Any help on troubleshooting appreciated!