deviance residuals, in the frequentist sense, are defined as
sign * sqrt(saturated.deviance)
where 'sign' is usually taken as the sign of y-y.predicted
all this is pr observation, so I avoid the _i notation.
In the Bayesian framework, there is no natural definition of residuals,
but we can define it as
sign * sqrt(E(saturated.deviance))
where the E() is over the posterior, like integrating out
hyperparameter(s) and the uncertainty of the linear predictor.
the 'sign' is a different story, as there is no definition of the 'sign'
now. it is defined as attached, which is 'very likely' in correspondance
with the freq.definition. Another issue, is that I do not know, in this
part of the code, if data are discrete or not, so...
well, I know all this is a little 'loose', but it is anyhow useful to
have some kind of 'residuals' available, although they should not be
used for any kind of ''testing''-purpose.
of'course, for some models, like binary data, then all this make less
sense, but this is well know
If anyone has other options or other comments, please let us know
Best
H