Inferring $p$ and $n_I$ with our `standard parameters'

Let us start using as $n_P$ the expected value of positives of $\approx 2010$, obtained from what has been our starting set of parameters through the paper, that is $p=0.1$ with $n_s=10000$, with the uncertain parameters $\pi_1$ and $\pi_2$ modeled by Beta distributions with $(r_1=409.1,\,s_1=9.1)$ and $(r_2=25.2,\,s_2=193.1)$, respectively. Also for the prior of $p$ we use a Beta, starting with $r_0=s_0=1$, that models a flat prior, although we obviously do not believe that $p=0$ or $p=1$ are possible. We shall discuss in Sec. [*] the role of such at a first glance an insane prior (see also Sec. [*]).

These are the R command to set the parameters of the game, call JAGS and show some results (for the complete script see Appendix B.10).

#---- data and parameters
nr = 1000000
ns = 10000
nP = 2010
r0 = s0 = 1
r1 = 409.1; s1 = 9.1
r2 = 25.2;  s2 = 193.1 

# define the model and load rjags (omitted)
# ......................................... 

#---- call JAGS ---------
data <- list(ns=ns, nP=nP, r0=s0, s0=s0, r1=r1, s1=s1, r2=r2, s2=s2)  
jm <- jags.model(model, data)
update(jm, 10000)
to.monitor <-  c('p', 'n.I')
chain <- coda.samples(jm, to.monitor, n.iter=nr)

#---- show results
print(summary(chain))
plot(chain, col='blue')

Here are the results shown by `summary(chain)'
1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

         Mean        SD  Naive SE Time-series SE
n.I 991.12477 225.85901 2.259e-01      16.079460
p     0.09919   0.02278 2.278e-05       0.001601

2. Quantiles for each variable:

         2.5%       25%      50%       75%     97.5%
n.I 506.00000 838.00000 1012.000 1153.0000 1389.0000
p     0.05046   0.08372    0.101    0.1155    0.1396

So, for this run we get $p=0.0992 \pm 0.023$ and a number of infectees in the sample equal to $991\pm 226$, in agreement with our expectations. The results of the Monte Carlo sampling are shown in the `densities' of Fig. [*],
Figure: Plots showing some JAGS results (see text).
\begin{figure}\begin{center}
\epsfig{file=JAGS_plots_standard_conf.eps,clip=,width=\linewidth}
\\ \mbox{} \vspace{-1.0cm} \mbox{}
\end{center}
\end{figure}
together with the `traces', i.e. the values of the sampled variables during the $10^6$ iterations.47As it is easy to guess and as it appears from the two traces of the figure, there is some degree of correlation between the two variables, because they are obtained in a joint inference. The correlation is made evident in the scatter plot of Fig. [*]
Figure: Scatter plot of $p$ vs $n_I$, showing the very high correlation between the two variables.
\begin{figure}\begin{center}
\epsfig{file=JAGS_plots_standard_conf_correlation....
...dth=0.8\linewidth}
\\ \mbox{} \vspace{-1.0cm} \mbox{}
\end{center}
\end{figure}
and quantified by $\rho(p,n_I) = 0.9914.\,$48