Compute the deviance residuals under the binomial model averaged over all entries as the prediction error.
Arguments
- G
The I x J matrix of counts; all entries of G should be taken from {0,1,2}.
- result
Output of
psd_fit_em
,psd_fit_sqp
, orpsd_fit_vi
.
Examples
G <- matrix(c(0,0,1, 0,2,1, 1,0,1, 0,1,0, 1,0,0), 3, 5)
result <- psd_fit_em(G, 2, 1e-5, 10)
psd_error(G, result)
#> [1] 0.157153