A Pearson residual is defined as:
$r_{i}(\theta)=\frac{y_{i}-E(y_{i}|\theta)}{\sqrt{Var(y_{i}|\theta)}}\tag{1}$
Sum of squared standard residuals $X^{2}$ is:
$X^{2}=\sum_ir_i^2\tag{2}$
where $y_{i}$ is $i$th random variable ($i$ = 1, 2, . Also.., N). {\theta}$\theta$ is also a random variable since it's about Bayesian inference, but this particular question is about "given $\theta$", so I think we can think $\theta$ not "random". N is the number of dependent variables y.
In a binomial model y[i] ~ dbin(theta, n[i])
, it is said that for known $\theta$, we might expect $X^{2}$ to be around the number of y[i].
for known $\theta$, we might expect $X^{2}$ to be around N.
For an example in Appendix A, we can expect $X^{2}$ to be 12, given the known posterior $\theta$ = 0.12 (median value). The prior distribution of $\theta$ is uniform. $i$ has the value of 1, 2, 3, ..., 12
because there are twelve hospitals.
The problemThe problem is,:
I can prove it$X^{2}\approx 12$ through simulation in R, as shown in Appendix B. However, I do not know how to prove it mathmatically.