Solution (source code)

= Solution

The <Poisson trick> introduces $\lambda_i=\log\mu_{i1}$. With an exactly flat log-rate prior, the baseline prior measure is $du_i/u_i$. For $n_i>0$,
$$
\int_0^\infty u_i^{n_i-1}e^{-S_i u_i}\,du_i
=\Gamma(n_i)S_i^{-n_i}.
$$
Thus <flat log-rate marginalization gives the multinomial likelihood>:
$$
\boxed{p(\mathbf y\mid\beta)\propto
\prod_i\frac{\exp\{\sum_k y_{ik}\eta_{ik}\}}{S_i^{n_i}}.}
$$
Alternatively, independent Poisson counts conditional on their total are exactly <multinomial distributions> with probabilities $e^{\eta_{ik}}/S_i$. Locally uniform coefficient priors make the coefficient posterior proportional to this likelihood within their flat region.

The printed BUGS prior is a proper <normal distribution> on $\lambda_i$, with variance $s^2=10^5$, since BUGS uses precision as its second argument. It is broad but not exactly flat. Substitution $v=S_i u_i$ shows that, apart from a coefficient-independent constant, the integrated likelihood is the multinomial kernel times the <Gaussian log-rate correction to the Poisson trick>
$$
\boxed{R_i(S_i)=
\mathbb E_{V\sim\operatorname{Gamma}(n_i,1)}
\left[\exp\left\{-\frac{(\log V-\log S_i)^2}{2s^2}\right\}\right].}
$$
It depends on the coefficients through $S_i$. <Dominated convergence> gives $R_i\to1$ as $s^2\to\infty$, so the finite-variance code yields \b[an approximation to the multinomial posterior], not exact equality. Large log rates can make prior sensitivity relevant.

The cell-wise factors form a standard <Poisson regression>, convenient for BUGS. They avoid an explicitly constrained count vector and permit scalar log-concave updates for intercepts and coefficients; an exactly flat-log-rate implementation also gives gamma conditional baseline rates. This can be computationally efficient, although the actual log-normal baseline prior is not gamma-conjugate and introduces $I$ nuisance intercepts. Efficiency depends on the update scheme.