Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact distribution vs. offspring distribution #35

Closed
sbfnk opened this issue Dec 6, 2023 · 4 comments
Closed

Contact distribution vs. offspring distribution #35

sbfnk opened this issue Dec 6, 2023 · 4 comments

Comments

@sbfnk
Copy link

sbfnk commented Dec 6, 2023

If I understand correctly then what is currently called a contact distribution is actually an offspring distribution - if it was a contact distribution then for anyone after the initial case the number of offspring would have to be drawn from $q(n)\sim(n+1)p(n+1)$ if $p(n)$ is the probability of having $n$ contacts (because choosing someone at random by following up a contact chooses individuals with probability proportional to their number of contacts). The plus 1 is because one of the contacts was "used" to infect the person.

@joshwlambert
Copy link
Member

The contact distribution, as it is currently implemented (let me know if it should be renamed) is used to generate random numbers of contacts per cases that did not get infected. The offspring distribution is fixed in bpmodel::chain_sim() (.sim_bp_linelist()).

At the moment, the offspring and contact distribution are independent. The offspring distribution is used to produce the infected cases, and the contact distribution is used to produce the non-infected. The reason for including the contact distribution was to give some functional form (that can be changed by the user) to the randomness when producing the contacts table for those not infected.

@joshwlambert
Copy link
Member

Thinking about this more, perhaps it relates to, and might be easier for formulate with the secondary attack rate.

If we have the number of cases from each individual (given by output of bpmodels::chain_sim()), and instead of getting the user to supply a contact distribution, they instead supply a secondary attack rate, we could sample the number of non-infected contacts by:

$$ total \ contacts = \frac{No. \ new \ cases}{SAR \times 100} $$

@sbfnk
Copy link
Author

sbfnk commented Jan 9, 2024

At the moment, the offspring and contact distribution are independent

It really shouldn't be as one determines the other - is there a reason for this? It would be straightforward to construct an offspring distribution from the contact distribution (as per the above, just need to weigh by # of contacts) and pass that to <bpmodels>.

Thinking about this more, perhaps it relates to, and might be easier for formulate with the secondary attack rate.

This could give the mean but one would still somehow model overdispersion.

@joshwlambert
Copy link
Member

@sbfnk and I have met to discuss this issue and best approach to solve it. This issue stems from the method/architecture of how infections are initially simulated with a branching process model (bpmodels::chain_sim()) and then the contacts for each infected individual are attached by sampling from a contact distribution. Ideally, these two steps should be simulated in a single process, with the above friendship/network effect as pointed out in the original comment included.

Therefore, the agreed next step (Seb please correct if you disagree) is to implement a network branching process simulation that can produce contacts and infections given a contact/degree distribution and a probability of infection per contact. Where this functionality will live long-term is not yet decided, but it could eventually be ported to one of the Epiverse-TRACE R packages on branching processes.

I will create a new issue to outline the aims specific to the problem, and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants