mrc-ide / vivax

Individual-based model for P. vivax malaria transmission
MIT License
2 stars 1 forks source link

Seasonality alignment #19

Closed pwinskill closed 4 years ago

pwinskill commented 4 years ago

Was just wondering is we could add a the fourier seasonality parametrisation to the vivax model to align with the falciparum model. That way we would be using a consistent set of seasonal parameters for both.

The vivax model uses the same method as the "original" faciparum publication (2010). The Pf model actually still has both methods and a switch:

double Mosq_pop::seasonal_x(const double x) const{
    const double two_pi=6.2831853071796;
    double y=0;
    if(use_fourier){
        y=a0; 
        for(int i=0; i<a.size(); i++)
            y += a[i]*cos(two_pi*x*(i+1)) + b[i]*sin(two_pi*x*(i+1));
    }
    else
        y=c+(1-c)*pow(0.5*(1+cos(two_pi*x)), k)*0.5*two_pi*exp(gammln(k+1.0) - gammln(0.5) - gammln(k+0.5));
    return y;
}

Would it be possible to add the use_fourier mehod here into the vivax model . I think it would only impact a few lines in the model (1177, 1639 of model.cpp), plus parameter inputs?

giovannic commented 4 years ago

Sure, will look into it

giovannic commented 4 years ago

Could you link the lines on github? I'm not sure I'm looking at the same version of the code as you 😄

pwinskill commented 4 years ago

So in the Pf model it is: https://github.com/mrc-ide/Malaria_model/blob/25a90f163817bee78a15ff4dbd68665108189d35/code/mosq.cpp#L555

And in the Pv model: https://github.com/mrc-ide/vivax/blob/f77c7492bd0a9cc7cd1bf67f5cd75b5b3c46afec/src/model.cpp#L1167 and https://github.com/mrc-ide/vivax/blob/f77c7492bd0a9cc7cd1bf67f5cd75b5b3c46afec/src/model.cpp#L1639