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

Instantiate infections earlier? #67

Open
afmagee42 opened this issue Dec 30, 2024 · 4 comments
Open

Instantiate infections earlier? #67

afmagee42 opened this issue Dec 30, 2024 · 4 comments

Comments

@afmagee42
Copy link
Contributor

Per this thread

@afmagee42 afmagee42 changed the title Infections generate infections? Instantiate infections earlier? Dec 30, 2024
@afmagee42
Copy link
Contributor Author

afmagee42 commented Dec 30, 2024

@swo I'm making this issue mostly so I can write out why I have come to think this is a bad idea.

The short version is that I think we're already teetering on the edge of ungeneralizable counterfactualism and this would push us over the edge.

Right now, we have infections generating the entire vector of times they might end up infecting others. This is only possible in certain kinds of models, like the current density-independent branching process. In a model with a network, or if we want to account for depletion of susceptibles, we cannot do this. In the general sense, this is because the infections caused by individuals are no longer independent. More specifically, we can think of it as being because an individual doesn't have an infection rate, they have an infection rate function, and this function is dependent on other aspects of the state of the population.

So the earliest we actually really want to be instantiating an infection is when it's next in the queue, because after we know what the next infection is, we may need to re-generate the entire queue.

@swo
Copy link
Contributor

swo commented Dec 30, 2024

Even if we keep the scope here to just this branching process approach? I've been thinking we keep the scope of this repo to just that question. If we want to do network simulations, we'll do that outside of a widget. This should be simple and purpose-built.

@afmagee42
Copy link
Contributor Author

Yes. We'd have to commit to a subset of branching processes where the infection rate $\lambda(i, t)$ of infection $i$ at time $t$ is more or less independent of other infections.

What does "more or less" mean? For a model where there's a dependence on the total number of infections $I(t)$, once we know that infection $i$ causes a secondary infection at time $t$, the entire rest of the already-drawn infection times (for $i$ and all other concurrent infections) are invalidated and must be re-drawn (so pre-instantiation is bad). So, $\lambda(i, t)$ can't depend on the number of infections $I(t)$ or the number in any category $I(i, t)$. It could be variable among infections in heritable ways, so that $\lambda(i, t)$ could be affected by $\lambda(\text{infector}(i), t)$. I think the dividing line is the "birth" of the infection, so that $\lambda(i, t)$ can't depend on anything that happens at any time $t$ after $i$ is exposed/infected/born.

So, besides networks we can't do anything too close to a proper compartmental model, because there $\lambda(i, t) = \lambda(t) \propto I(t) S(t)$, so we hit the above problem of the first infection on the stack invalidating all other pre-drawn times.

But we could do:

  • A model with some form of overdispersion, where infectiousness is variable but IID in the population, $\lambda(i, t) = \lambda(i) \sim \text{someDistribution}(\theta)$. This could be super-spreader-like (there are two birth rates, low and high, each infection has a small probability of having the high rate) or Negative-Binomial-like overdispersion (for fixed duration of infectiousness, if the rate is drawn from the right Gamma, we'd have a Negative Binomial branching process).
  • A multi-strain model, where perhaps $\lambda(i, t) = \lambda(i) = \lambda(\text{infector}(i))$ and we start with >= 1 index case per strain.
  • A model where infectiousness evolves, e.g. $\lambda(i, t) = \lambda(i) \sim \text{someDistribution}(\lambda(\text{infector}(i)), \theta)$.

@afmagee42
Copy link
Contributor Author

If you're happy with drawing that box around what this app can do, I've got a branch I can revive where I was working on this before I had these thoughts.

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