Open boyercb opened 1 year ago
@edknock - is this something you can answer?
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}$.
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 ofI[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?