jackolney / CareCascade

CareCascade Model Repository
0 stars 0 forks source link

Prevalence at 10% of what is should be. #20

Closed jackolney closed 9 years ago

jackolney commented 9 years ago

Why?

jackolney commented 9 years ago

Beta should be included post-2002 Priority is to fix pre-2002 first

jackolney commented 9 years ago

I've got a feeling that IRR are being picked from the beginning of the distribution only. i.e. from early ages only.

jackolney commented 9 years ago

I think this is now an issue with rounding in population::CalculateIncidence()

        /* Find Incidence(a,s) */
        for(size_t j=0;j<34;j++) 
            incidence[j] = Round(lambda * people.at(j).size() * IRR[j]);

Because we Round() the Susceptibles[j] * IRR[j] for each Age and Sex vector then we lose some resolution in our incidence.

If we don't Round() here then we reproduce the total incidence that we are putting into the model (being driven by SpectrumIncidence[32] prior to 2002). However, the problem arises as we need to supply an integer to GetCases() as we need the number of cases that are going to be infected in the next year stratified by age and sex as an integer, we cannot use a double.

jackolney commented 9 years ago

The above is quite fun and certainly fills the gap in incident cases. Prevalence is still low though...

        /* Find Incidence(a,s) */
        for(size_t j=0;j<34;j++) 
            incidence[j] = theRng->Sample( (lambda * people.at(j).size() * IRR[j]) - int(lambda * people.at(j).size() * IRR[j]) ) + int(lambda * people.at(j).size() * IRR[j]);
jackolney commented 9 years ago
jackolney commented 9 years ago

IT IS IN THE POPULATION

jackolney commented 9 years ago

Issue fixed The culprit was a crap population distribution. I was inputting the total population size each year. Which was of course producing an enormous HIV-negative population.

const double popSize [60] = {11252466,11657477,12083159,12529800,12997438,13486241,13995996,14527242,15081677,15661480,16267906,16901167,17559844,18241424,18942464,19660018,20392312,21138372,21896890,22666720,23446439,24237056,25036941,25839132,26634659,27418077,28186224,28943647,29702246,30478597,31285050,32126351,33000524,33905011,34834606,35785718,36757498,37752304,38773277,39824734,40909194,42027891,43178141,44359872,45573945,46821246,48102684,49419194,50771734,52161292,53588880,55055540,56562340,58110380,59700787,61334722,63013375,64737971,66509767,68330055};

When I should have been putting in the Initial population size and then the number of new individuals entering the model, as below:

const double popSize[60] = {11252466,400695,419630,440241,460305,481118,502226,523708,546673,570847,594209,619182,644442,667076,682797,695625,709410,722491,731131,734908,765901,776599,784373,783075,765226,722958,718529,708110,715455,729361,750663,775364,799972,814589,845603,856064,881087,915869,946729,983062,1028592,1055553,1080443,1096579,1106563,1112580,1117645,1126043,1136366,1148139,1163788,1191180,1219216,1247912,1277283,1307346,1338116,1369610,1401846,1434841};