%% Ecological model
\begin{eqnarray*}
y_i|\phi_i,\nu_i &\sim& \mbox{Poisson}(\mu_i)=\mbox{Poisson}(p_i \rho_i)\\
\log\mu_i&=&\log p_i + \log \rho_i = \log p_i + \beta_0+\beta_1x_{i1}+\beta_2x_{i2} +\phi_i+\nu_i\\
\phi_i&\sim&\mbox{Normal}(0,\sigma^2_\phi)\\
\nu_i|\nu_{j\neq i}\sim\mbox{N}\left(\frac{\sum_{j\neq i} w_{ij}\nu_j}
{\sum_{j\neq i} w_{ij}},\frac{\sigma^2_\nu}{\sum_{j\neq i} w_{ij}}\right)\\
\beta_0&\sim&\mbox{U}(-\infty,+\infty)\\
\beta_1&\sim&\mbox{N}(0,1000)\\
\beta_2&\sim&\mbox{N}(0,1000)\\
1/\sigma^2_\phi&\sim&\mbox{Gamma}(0.5,0.005)\\
1/\sigma^2_\nu&\sim&\mbox{Gamma}(0.5,0.005)\\
\end{eqnarray*}


%% Ecological model with individual masurements on water hardness x2
\begin{eqnarray*}
y_i|\phi_i,\nu_i &\sim& \mbox{Poisson}(\mu_i)=\mbox{Poisson}(p_i \rho_i)\\
\log\mu_i&=&\log p_i + \log \rho_i = \log p_i + \beta_0+\beta_1x_{i1}+\beta_2\mu_{x_2,i} + \beta_2^2\frac{\sigma^2_{x_2,i}}{2} +\phi_i+\nu_i\\
x_{2,ij} &\sim& \mbox{Normal}(\mu_{x_2,i},\sigma^2_{x_2,i}) \\
\mu_{x_2,i}&\sim&\mbox{Normal}(0,1000)\\
1/\sigma^2_{x_2,i} &\sim& \mbox{Gamma}(0.5,0.005) \\
\phi_i&\sim&\mbox{Normal}(0,\sigma^2_\phi)\\
\nu_i|\nu_{j\neq i}\sim\mbox{N}\left(\frac{\sum_{j\neq i} w_{ij}\nu_j}
{\sum_{j\neq i} w_{ij}},\frac{\sigma^2_\nu}{\sum_{j\neq i} w_{ij}}\right)\\
\beta_0&\sim&\mbox{U}(-\infty,+\infty)\\
\beta_1&\sim&\mbox{N}(0,1000)\\
\beta_2&\sim&\mbox{N}(0,1000)\\
1/\sigma^2_\phi&\sim&\mbox{Gamma}(0.5,0.005)\\
1/\sigma^2_\nu&\sim&\mbox{Gamma}(0.5,0.005)\\
\end{eqnarray*}



