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

Test for AgeBaseHINT fails when targeting the first age bin #29

Open
YeChen-IDM opened this issue Dec 7, 2023 · 8 comments
Open

Test for AgeBaseHINT fails when targeting the first age bin #29

YeChen-IDM opened this issue Dec 7, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@YeChen-IDM
Copy link
Collaborator

SImulation:
https://comps2.idmod.org/#explore/Simulations?filters=Id=592b31df-5095-ee11-92fe-f0921c167864&offset=0&count=100&selectedId=592b31df-5095-ee11-92fe-f0921c167864

My demographic:

{"Age_Bin_Edges_In_Years":[0,5,20,60,-1],
"Property":"Age_Bin",
"TransmissionMatrix":{
"contact":{"
Matrix":[[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0]]},
"environmental":{
"Matrix":[[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0]]}}}

This should target the first age bin (0-5] only. I have one outbreak at day 1 and count the NewInfectionEvent in ReportEventRecorder.csv.

I expect NewInfectionEvent only happen in age bin (0-5] after day 1. But I got:
Age Bins: [Interval(0, 5, closed='right'), Interval(5, 20, closed='right'), Interval(20, 60, closed='right'), Interval(60, 150, closed='right')].
Good: There are some transmission for age bin: (0, 5],found 113 new infection.
BAD: Expected no transmission for age bin: (5, 20], found 1 new infections.
Good: There is no transmission for age bin: (20, 60].
BAD: Expected no transmission for age bin: (60, 150], found 3 new infections.
SUMMARY: Success=False

Please see these files for the values that I am looking at in the test:
image

@YeChen-IDM
Copy link
Collaborator Author

Here are the time step of the 4 unexpected cases:
image
image
image
image

The case in the second age_bin (5-20] may due to aging? but aging can't explain the 3 cases in the 60+ age bin.

@jonathanhhb jonathanhhb self-assigned this Dec 7, 2023
@jonathanhhb jonathanhhb added the bug Something isn't working label Dec 7, 2023
@jonathanhhb
Copy link
Collaborator

This is a perfect bug report, btw! :)

@YeChen-IDM
Copy link
Collaborator Author

The individual has age = 148 years old ??
image

@jonathanhhb
Copy link
Collaborator

235,2005.13,1,NewInfectionEvent,2960,53045.1,M,1,6717.5,145.3290410958904,"(60.0, 150.0]"
252,2005.23,1,NewInfectionEvent,330,56985.1,M,1,6717.5,156.12356164383561,
253,2005.24,1,NewInfectionEvent,927,58349.3,F,1,6717.5,159.86109589041098,
263,2006.28,1,NewInfectionEvent,1954,54100.8,M,1,6717.5,148.2213698630137,"(60.0, 150.0]"
(venv_typhoid) [[email protected]@ipadvapp06 future_campaign]$

They all seem very old!

(We shouldn't have >125yo in the model actually.)

Might not be an Age-Based HINT bug but rather an artifact of these methuselahs.

@jonathanhhb
Copy link
Collaborator

There might be a value in our demographics.json (we're doing the basic demographics by file, not by code) that should really be 0.

@jonathanhhb
Copy link
Collaborator

                        95,
                        100,
                        120
                    ],
                    "DistributionValues": [
                        0,
                        0.1264,
                        0.2502,
                        0.3698,
                        0.4808,
                        0.5786,
                        0.6615,
                        0.7355,
                        0.7981,
                        0.8451,
                        0.8803,
                        0.9108,
                        0.938,
                        0.9594,
                        0.9754,
                        0.9868,
                        0.994,
                        0.9979,
                        0.9995,
                        0.9999,
                        1,
                        1

Looks fine.

@jonathanhhb
Copy link
Collaborator

This can be closed. It is actually covered by #30.

@jonathanhhb
Copy link
Collaborator

Big update on this...

First, the "Methuselah Problem" is a known issue when using SIMPLE initial age and a distribution like exponential. In practice we expect users to handle this with aggressive natural mortality in the first timestep. For testing purposes, it's probably better to use uniform distribution which lets you set a max age like 100.

Even after we did that in our test, we had a new problem: With a Run_Number of 1 (not 0, or 2, or other values tested) we got 1 NewInfection in the wrong bucket: We have a boy just past his 5th birthday getting an infection. The matrix says that should be impossible. It's not a terrible bug in the grand scheme of things, but it should be run to ground.

I checked whether there was a missing transition, but everything seems fine. I checked whether this was a new birth in the sim. It was not. I also checked whether this person received the expected PropertyChange from the 0-5 age bin to the 5-20 age bin, and they did indeed get the property change before the new infection. So they seem to be getting infected while having a 5-20 property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants