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

Bug in active detection? #33

Open
afmagee42 opened this issue Dec 18, 2024 · 11 comments
Open

Bug in active detection? #33

afmagee42 opened this issue Dec 18, 2024 · 11 comments

Comments

@afmagee42
Copy link
Contributor

Using #32, moving the active detection probability slider around has very little impact on the outcomes.

At 500 simulations, otherwise default settings, I'm seeing:

  • Active prob 4%: control prob 68%, average duration of infectiousness 2.04, $R_e$ 0.98, prob of active detection 0
  • Active prob 49%: control prob 68%, average duration of infectiousness 2.04, $R_e$ 0.98, prob of active detection 0.02
  • Active prob 82%: control prob 70%, average duration of infectiousness 2.01, $R_e$ 0.96, prob of active detection 0.05

Why is active detection not happening?

@afmagee42
Copy link
Contributor Author

afmagee42 commented Dec 18, 2024

[Some thinking aloud]

Since the passive detection delay is 2, we can potentially actively detect new infections that arise in the first unit of time of the duration of infectiousness of a passively-detected individual. This on average is 0.5 infections (birth rate being used is 0.5). Thus I would expect something like 0.25 active detections per passive detection, ignoring active-active chains of detection.

Since the active detection delay is 2, and the latent duration is 1, any such actively-detected infection should arise in its own first unit of infectious time. Since infection times are uniform, this is an average of 0.25 new infections which could be actively detected after an active detection.

On the other hand, if I passively detect the index case, there's a probability this leads to immediate extinction. That probability is 1/3 under these parameters. Which should decrease the marginal active detection probability because in 1/3 of simulations there's no one to actively detect.

@afmagee42
Copy link
Contributor Author

Maybe this isn't wrong but just deeply counter-intuitive?

Fixing delays and rates, if I passively detect a case, on average

  • It's caused 0.5 infections
  • I detect p_active_detect * 0.5 next-infections actively
  • I detect p_passive_detect * (1 - p_active_detect) * 0.5 next-infections because active happens first when it happens

If I don't passively detect a case

  • It causes on average 1.5 next-infections
  • I actively detect 0 of these, because I missed this infection
  • I passively detect p_passive_detect * 1.5

So, the marginal proportion of next-infections passively detected isn't hugely affected by whether or not a particular infection is detected (we lose a small chunk of a small number to active detection). But the reverse is not true, because for every infection we miss, we get a lot more infections we could never actively detect.

@afmagee42
Copy link
Contributor Author

Paging @swo because my brain now hurts

@swo
Copy link
Contributor

swo commented Dec 18, 2024

I think my first antidote is #14 ; we should have some unit tests for the "do detections" function, and make sure it's doing what we think it should

I think my second antidote is #23 (unless overcome by another issue), so we can visualize what is happening in the simulations!

@afmagee42
Copy link
Contributor Author

Agree that those will help make sure that the "problem" is actually just unintuitive emergent behavior.

@afmagee42
Copy link
Contributor Author

Signs pointing to bug, via 920c8a0 we can get a passive-passive chain when active detection probability is 100% and active detection delay is 0.0.

image

@afmagee42
Copy link
Contributor Author

afmagee42 commented Dec 18, 2024

Active chains are fine (as below), but all passive detections which are followed by detections should be followed by an active detection... right?

image

@swo
Copy link
Contributor

swo commented Dec 18, 2024

we can get a passive-passive chain when active detection probability is 100% and active detection delay is 0.0.

I think this is OK? (Unless you meant that passive detection delay were 0?) Two people in a chain can be passively detected after they transmit.

@afmagee42
Copy link
Contributor Author

Right. The later infection is actually detected first. Generation-views hurt my brain.

@afmagee42
Copy link
Contributor Author

I bet this is related to #53. That bug would (sort of) make active vaccination behave as if it had a random delay from t_exposed that was 1 + Uniform(0, 3), so it would lose out to passive when it shouldn’t.

@swo
Copy link
Contributor

swo commented Dec 27, 2024

Agree that #53 likely will solve this

And/or we can use #55 to see what is going on!

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