To find optimal patterns of transmission investment, we use the optim function in R version 3.0.2 and define the cumulative transmission potential as our measure of fitness. This metric translates daily estimates of gametocyte density into the probability of that density resulting in an infected mosquito, assuming mosquitoes are abundant and biting hosts on a regular basis. The relationship between gametocyte densities and transmission probability is assumed to be sigmoidal, as has been experimentally derived for P. chabaudi by Bell et al. (2012). Using their parametrization, our fitness function is calculated as(11)f(η)=∫0ηe−12.69+3.6log10G(t)1+e−12.69+3.6log10G(t)dt,where G(t) is the gametocyte density at time point t, and η is the day postinfection at which our simulated infection ends. A sigmoidal relationship between gametocyte density and transmission success has also been reported for P. falciparum (Huijben et al., 2010) and gives similar results if used instead of the fitness function described here (see Figure A.3 in Appendix A). Our model describes early infection dynamics, before major adaptive immune responses develop. We therefore simulate a 20‐day infection over which we calculate the cumulative transmission potential, as has been done previously (Greischar et al., 2016a).