The Error message
'undefined real result' indicates numerical overflow.
Possible reasons include:
- Initial values generated from a 'vague' prior distribution may be numerically extreme - specify appropriate initial values;
- Numerically impossible values such as log of a non-positive number - check, for example, that no zero expectations have been given when Poisson modelling;
- Numerical difficulties in sampling.
Possible solutions include:
- Better initial values;
- More informative priors - uniform priors might still be used but with their range restricted to plausible values;
- Better parameterisation to improve orthogonality;
- Standardisation of covariates to have mean 0 and standard deviation 1.
Probit models are particularly susceptible to this problem, i.e. generating undefined real results. If a probit is a stochastic node, it may help to put reasonable bounds on its distribution, e.g.
probit(p
) <- delta
delta ~ dnorm(mu, tau)I(-5, 5)
This trap can sometimes be escaped from by simply clicking on the update button. The equivalent construction
p <- phi(delta)
may be more forgiving.