Methods
Model framework for one population
We work from a system of ordinary differential equations which delineate a population into classes based on current and past exposure to different strains of a pathogen. Pathogens with strain structure can differ in both the number of strains and the level of cross-reactive immunity afforded by past exposure to similar strains. To model the number of strains, we signify a strain i = {x1, x2, ..., xn} as a set of n loci, each of which can take on a finite number of alleles. For instance, a pathogen with two loci (a and b) and two alleles at each loci has a total of four potential strains: {a1, b1}, {a1, b2}, {a2, b1}, {a2, b2}. For cross-reactive immunity, we use a parameter γ which indicates the degree of reduced susceptibility a host has to strains that are similar to (i.e. strains that share at least one allele with one another) past exposures. Importantly, in this framework, the number of strains is fixed and finite. While strains may go extinct over time, there is no process for the generation of new strains or to re-introduce strains that had previously gone extinct (but see \citealt{Gupta_1998}).