Inferring and with our `standard parameters'
Let us start using as the expected value of positives of
,
obtained from what has been our starting set of parameters through the paper,
that is with , with the uncertain parameters
and modeled by Beta distributions with
and
, respectively. Also for the prior of
we use a Beta, starting with , that models a flat
prior, although we obviously do not believe that or 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
and a number of infectees in the sample equal
to
, 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).
|
together with the `traces', i.e.
the values of the sampled variables during the
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 vs ,
showing the very high correlation
between the two variables.
|
and quantified
by
48