mrc-ide / odin.dust

Compile odin to dust
https://mrc-ide.github.io/odin.dust
Other
3 stars 1 forks source link

Question about age-structured model #129

Open boyercb opened 1 year ago

boyercb commented 1 year ago

https://github.com/mrc-ide/odin.dust/blob/7b8109184a61671d62e6b68937dae8183209d2bc/vignettes/sir_models.Rmd#L153-L154

Maybe a silly question. But why here is it I[i] instead of I[j] as in the equation above and why do you sum across rows instead of columns? Does this have to do with how the DSL interprets these?

richfitz commented 1 year ago

@edknock - is this something you can answer?

edknock commented 1 year ago

s_ij[i, j] gives the contact rate for individuals of age i making contacts with all infectives of age j. There is just a typo then, which should be I[j]. (Compare with a correct version of this equation here https://github.com/mrc-ide/odin-dust-tutorial/blob/main/models/sir_age.R#L17). Perhaps you want to correct this @richfitz.

lambda[i] gives the force of infection on an individual of age i, which in this case requires summing over the contact rates with infectives of all age groups, hence we are summing over the j index of s_ij[i, j].

Note that sum(s_ij[i, ]) can be represented mathematically as $\sumj s{ij}$.

LloydChapman commented 1 year ago

Isn't there also a typo in the beta/N? I think it should just be beta, with the division done by age group in the definition of the transmission matrix m. This would then agree with the code. If so, this typo also appears in eqn (1) on p17 of the WOR paper.