MJomaba / flu-evidence-synthesis

Code for reconstructing influenza dynamics from surveillance data using evidence synthesis techniques
19 stars 10 forks source link

"contact_ids" #52

Open gracewutw opened 7 years ago

gracewutw commented 7 years ago

In the example of predictting efficacy of different vaccination scenarios, there is a line using "inference.results$contact_ids". contact_ids=inference.results$contact.ids[i,] Is that just an index matrix with nrow=number of posterior sample (1000 in the example) and ncol=number of observations in polymod data (597 in the example)?

Moreover, when we ran the "more in depth example", we found contact.ids is not a matrix form in "mcmc.result", so we try the following codes to construct an index matrix (nrow=100), and replace "inference.results$contact.ids" with "a1". Is it a correct way? And when we have 1 million posterior samples, should we change nrow to 1 million (in that case, it becomes a very large matrix)? a=c() for ( j in 1 :597) { a=c(a,rep(j,100))} a1=matrix(a, nrow = 100, ncol = 597)

BlackEdder commented 7 years ago

In the example of predictting efficacy of different vaccination scenarios, there is a line using "inference.results$contact_ids". contact_ids=inference.results$contact.ids[i,] Is that just an index matrix with nrow=number of posterior sample (1000 in the example) and ncol=number of observations in polymod data (597 in the example)?

Yes that is correct

Moreover, when we ran the "more in depth example", we found contact.ids is not a matrix form in "mcmc.result",

In the more indepth examples the contact ids not part of the mcmc.results but stored in the separate object contact.ids

To get a similar object as in the simpler example you could at the end use:

mcmc.results[["contact.ids"]] <- contact.ids

so we try the following codes to construct an index matrix (nrow=100), and replace "inference.results$contact.ids" with "a1". Is it a correct way?

I am not sure what you mean here.

And when we have 1 million posterior samples, should we change nrow to 1 million (in that case, it becomes a very large matrix)?

Yes, although I would suggest keeping a limited number of samples (I personally tend to use 5000). If you want to increase the run time/number of loops, without increasing the number of posterior samples (nbatch) you can increase blen (length of each batch)