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

Interpret offspring distribution as degree distribution #204

Open
sbfnk opened this issue Feb 6, 2024 · 4 comments
Open

Interpret offspring distribution as degree distribution #204

sbfnk opened this issue Feb 6, 2024 · 4 comments

Comments

@sbfnk
Copy link
Contributor

sbfnk commented Feb 6, 2024

The branching process model assumes that the probability of becoming infected is independent of the subsequent offspring distribution. This is unrealistic if the branching process is driven by heterogeneity in contacts. An offspring distribution that assumes a random infinite network can be derived from the uncorrected distribution by re-weighting the probabilities with the number of contacts (accounting for the initial contact), i.e. where the probability of having $n$ offspring is proportional to $p(n+1)(n+1)$, where $p(n)$ is the probability of having $n$ contacts.

We could add a function that translates between probability distributions interpreted as offspring distributions to probability distributions interpreted as contact distributions in this way.

If implementing this we could potentially then also implement use the analytical likelihood implemented in https://doi.org/10.1371/journal.ppat.1004452 (1.4 in the supplement).

Related to epiverse-trace/simulist#35

@sbfnk sbfnk changed the title Interpret offspring distribution as contact distribution Interpret offspring distribution as degree distribution Feb 6, 2024
@sbfnk
Copy link
Contributor Author

sbfnk commented Feb 6, 2024

If going with this we'd probably also want a parameter for probability of infection (such that each "offspring" doesn't necessarily get infected), in the same way as already implemented for depletion of susceptibles. We'd probably also want to keep track of uninfected contacts in the simulation code.

@joshwlambert
Copy link
Member

We could add a function that translates between probability distributions interpreted as offspring distributions to probability distributions interpreted as contact distributions in this way.

Could you outline how you would do this as we’re having some discussion on the {simulist} side to revert back to using the offspring distribution for the simulation function, while keeping the network effects that were discussed in {simulist} issue epiverse-trace/simulist#35?

@sbfnk
Copy link
Contributor Author

sbfnk commented Mar 11, 2024

That is a good question - I proposed this with the original workflow in mind where we'd know the probability masses that correspond to a given degree distribution. Since #188 we don't have this any more and only have the random sampler so I think the only way to do in a general manner this would be via Monte Carlo sampling, i.e. the random sampler for excess degree (with argument n for the number of random excess degrees to generate) given a random sampler for degrees would be a function that does:

  • choose large m (hoping it is large enough)
  • generate m random numbers d_i, i = 1..m, from the degree distribution using the given random sampler
  • generate a vector s = rep(d_i - 1, each = d_i)
  • sample n random elements from s using sample

The number of offspring could then be generated by binomial sampling from the random excess degrees with probability of infection.

It might make more sense to explain how this could be achieved given a specific distribution than to try and solve the general problem.

@joshwlambert
Copy link
Member

Thanks, if I follow correctly it is very similar to the current implementation in {simulist}, with perhaps the exception that is it more generalised to any arbitrary degree distribution?

In terms of what the user specifies and the function signature, would you always ask the user to give the excess degree distribution and the probability of infection, and then document that if the probability is 1 it is equivalent to the offspring distribution? Or are you thinking of making the function signature more complex to expose both cases to the user (i.e. specify either contact/excess degree distribution or offspring distribution).

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

No branches or pull requests

2 participants