Abstract
The robustness and statistical efficiency of phylodynamic models have been tested by many investigators. However, little attention has been given to model specification and inductive bias that can occur if the model is misspecified or provides an overly simplistic representation of the evolutionary process. Here, we carried out a study involving the simulation of HIV epidemics using a complex model and calibrated to men who have sex with men from San Diego, USA. We then used this epidemic trajectory to simulate genealogies, sequence alignments equivalent to HIV partial pol gene and the complete genome. We proceeded to estimate migration rates using a simplistic representation of the epidemiological model by testing model-based phylodynamics and phylogeographic methods. We observed that even though there were some biases on the estimates using a simplistic representation of the epidemiological model, we were still able to estimate the migration rates depending on the method and sample size used in the analyses.
Keywords: phylodynamics, phylogeography, inductive bias, HIV
Introduction
Evolutionary epidemiology (Pybus et al., 2013) is the synthesis of molecular evolution and epidemiology and recent developments in this area enable researchers to utilize pathogen genetic sequences to inform their epidemiological studies. This includes identifying risk factors linked to ongoing transmissions, estimating what proportions of infections are coming from different risk groups and analysing migration patterns of infectious disease hosts (Dennis et al., 2014).
Whilst there have been many investigations into the statistical efficiency and robustness of phylogeographic approaches (De Maio et al., 2015; Jorgensen et al., 2023), relatively little attention has been given to the problem of model specification and inductive bias which can occur if a model is misspecified or provides an overly simplistic representation of the evolutionary system. This problem can be especially important to consider in the context of phylodynamic inference for infectious diseases where time scales are short but epidemiological dynamics, driven, in part, by human behaviour, are potentially quite complex. In this study, we examine the performance of a class of relatively simple model-based phylogeographic approaches on simulated data calibrated to a real HIV-1 epidemic in the United States. The data are simulated from a relatively complex and realistic model of the epidemiological and evolutionary process, accounting for differences in behaviour, the natural history of HIV infection, within-host evolution, population-genetic bottlenecks at the time of transmission, and incomplete sampling of the infected population. In contrast, the models used to infer HIV migration rates are quite minimal, but reflect current standard practice when engaging in phylogeographic inference. In this context, we evaluate how biased and/or powerful such methods are in the presence of realistic levels of inductive bias as represented within the context of the models we proposed.
Many methods for phylodynamic inference make use of a model which connects a genealogy to a model of population dynamics, thereby describing the joint evolutionary and demographic history of the pathogen. Several methods have been developed in this area (Kühnert et al., 2016; Lemey et al., 2009; Popinga et al., 2015; Smith et al., 2017; Stadler and Bonhoeffer, 2013; Vaughan et al., 2019; Volz, 2012; Volz and Frost, 2017), and we confine our analysis to methods premised on model-based inference with time-scaled phylogenies. For the specific problem of inferring migration rates, several inference paradigms are available: discrete-trait analysis premised on substitution models (Lemey et al., 2009), structured coalescent models (Beerli and Felsenstein, 2001; Hudson, 1990; Vaughan et al., 2014), approximations to the structured coalescent (De Maio et al., 2015; Müller et al., 2018; Rasmussen et al., 2014; Volz, 2012; Volz and Siveroni, 2018), structured birth-death models (Kühnert et al., 2016), and Markov genealogy processes (King et al., 2022). Within these paradigms, methods can further be categorized by whether they assume constant population sizes and migration rates (many structured coalescent models) or if, for example, they allow nonlinear dynamics (i.e. solutions of nonlinear ordinary differential equations) or assume exponential growth (structured birth-death). We expect model misspecification to impact these methods differently. In the present HIV modeling scenario involving the inference of an importation rate on the background of nonlinear dynamics, we expect approaches based on constant sizes and constant rates (substitution models) to be relatively more challenging.
Here we will discuss the methods based on the structured coalescent that are premised on a population dynamics model to describe transmission patterns (Volz, 2012). This approach therefore accommodates nonlinear dynamics and time-varying population sizes and migration rates. This mathematical model can be very simple, such as for example a SIR (susceptible-infected-recovered) model, or a more complex model describing transmissions by risk groups and stage of infections, such as compartmental models typically used to describe HIV dynamics (Le Vu et al., 2018). We also compared the minimum number of genetic sequences required to obtain robust results regarding the estimation of migration rates. Furthermore, we will also discuss the class of discrete-trait phylogeographic models migration between the regions as continuous-time Markov chains (du Plessis and Stadler, 2015; Lemey et al., 2009). These approaches include those that co-estimate a phylogeny (Lemey et al., 2009) or are conditioned on a phylogeny, further allowing us to gauge the relative computational requirements of these approaches and the importance of co-estimation of a phylogeny versus preconditioning on a phylogeny. Our results showed that we were able to estimate migration rates using a relatively simple representation of the epidemiological model using sample size of at least 1,000 sequences.
Methods
We carried out simulation analyses in three parts: (1) Model calibration and fit of simulated data to surveillance data from San Diego, CA, USA; (2) Simulation of coalescent phylogenetic trees; genetic sequence alignments and time-scaled trees; and (3) Phylodynamic analysis to estimate migration rates using the R package phydynR (Volz, 2017). We also tested additional phylodynamic/phylogeographic methods (Lemey et al., 2009; Pagel, 1994; Volz and Siveroni, 2018) to estimate migration rates.
Model calibration and fit to surveillance data
The first part of the simulation was to develop a more complex HIV epidemiological model which better describes a real HIV epidemic. Such a model has been previously described by Le Vu et al. (2018) and was used to fit our simulated data to surveillance data for incidence of diagnosis for men who have sex with men (MSM) in San Diego. This epidemiological compartmental mathematical model was structured into 120 compartments to simulate HIV epidemics (Le Vu et al., 2018). These compartments were represented by ordinary differential equations (ODEs) for HIV transmissions based on five stages of infection, four age groups, three diagnosis stages (not diagnosed; diagnosed and not on antiretroviral therapy (ART); and diagnosed and on ART), and two risk groups (20% of individuals were assigned to a high risk group and more likely to transmit). The five stages of infection were based on Cori et al. (2015) and defined as acute and early HIV; three stages of chronic infection; and AIDS. Importation or migration of lineages, represented by a source (src) compartment, was also modelled to account for HIV diversity and lineages with a common ancestor outside the region of interest. Note that the src compartment was modelled as a single compartment with growth rate described in Table 1. New migrants entered the population of interest in proportion to their sizes.
Table 1: Parameter values.
List of parameter values used in our simulations to fit surveillance data to simulated incidence of diagnosis.
| Parameter | Value |
|---|---|
| Age progression rate a | |
| Group 1 [18–27) | 1/9/365 day−1 |
| Group 2 [27–33) | 1/6/365 day−1 |
| Group 3 [33–40) | 1/7/365 day−1 |
| Group 4 [40–80.5) | 1/40.5/365 day−1 |
| HIV stage progression rate b | |
| Stage 2 (CD4 > 500 cells/mm3) | 1/3.32/365 day−1 |
| Stage 3 (350 < CD4 ≤ 500 cells/mm3) | 1/2.7/365 day−1 |
| Stage 4 (200 < CD4 ≤ 350 cells/mm3) | 1/5.5/365 day−1 |
| Stage 5 (CD4 ≤ 200 cells/mm3) | 1/5.06/365 day−1 |
| Fraction of individuals transitioning from b | |
| Stage 1 to stage 2 | 0.76 |
| Stage 1 to stage 3 | 0.19 |
| Stage 1 to stage 4 | 0.05 |
| Stage 1 to stage 5 | 0 |
| Age assortativity factora | 0.5 |
| Proportion of individuals in low-risk groupa | 0.8 |
| Per lineage rate of migration to regionc | 1/10/365 day−1 |
| Rate of growth of source compartmenta | 1/3/365 day−1 |
| Initial size of source compartmenta | 1,000 individuals |
| Incidence scaling factor of San Diego MSMd | 0.0189 |
| Diagnosis rate | |
| Fixed rate prior to 1985 | 0 |
| Maximum value of logistic function after 1985d | 0.2664 |
| Steepness of logistic function after 1985d | 0.1719 |
| Treatment rate a | |
| Fixed rate prior to 1995 | 0 |
| Maximum value of logistic function after 1995 | 1 |
| Steepness of logistic function after 1995 | 0.5 |
| Transmission weight conferred to individuals in a | |
| Stage 1 | 1 |
| Stages 2 to 4 | 0.1 |
| Stage 5 | 0.3 |
| Age groups 1 to 4 | 1 |
| Care status as undiagnosed | 1 |
| Care status as diagnosed and not on ART | 0.5 |
| Care status as diagnosed and on ART | 0.05 |
| Low-risk group | 1 |
| High-risk group | 10 |
Based on Le Vu et al. (2018)
HIV stages of infection were based in Cori et al. (2015). Stage 1 was equivalent to acute and early HIV stage of infection; stage 2 was equivalent to CD4 > 500 cells/mm3; stage 3 was equivalent to 350 < CD4 ≤ 500 cells/mm3; stage 4 was equivalent to 200 < CD4 ≤ 350 cells/mm3; and stage 5 or AIDS was equivalent to CD4 ≤ 200 cells/mm3.
Simulations were carried out using three different values: 1/10/365 day−1; 1/3/365 day−1; and 1/30/365 day−1.
These values were obtained using random Latin hypercube sampling (see text).
All parameters used in our HIV epidemic model are listed in Table 1. The parameter values not available from surveillance data (Table 1 and S1) were sampled using Latin hypercube sampling (LHS) (Stein, 1987) using the function randomLHS from the R package lhs version 1.1.6 (Carnell, 2022). We used trajectory matching to select the best combination of parameter values (Table 1 and Supplementary Material) to simulate phylogenetic trees and genetic sequence alignments.
Simulation of phylogenetic trees
We simulated phylogenetic trees using the complex and more realistic HIV model described in section “Model calibration and fit to surveillance data” using the parameter values in Table 1 and the structured coalescent model (SCM) (Volz, 2012) using the phydynR version 0.2.2 (Volz, 2017). These simulated trees will be referred to as “true trees”. In empirical analyses, true trees are not known a priori and must be inferred using genetic sequence data.
We then simulated 50 replicates of true trees for a combination of (1) 100 individuals in region which was representative of the MSM population in San Diego, and 100 individuals in src, which was representative of a bigger population that would account for importation of lineages from a global reservoir; (2) 300 individuals in region and 300 in src; (3) 1,000 individuals in region and 100 in src; and (4) 1,000 individuals in region and 500 in src.
To simulate the true trees, we provided a viral sampling date that was randomly sampled, ranging from 2005-01-01 to 2020-12-31 for individuals in region, and from 1980-01-01 to 2020-12-31 for individuals in src. Note that sampling date for individuals in the src compartment ranged from the beginning of the simulated epidemic to calibrate the molecular clock to estimate timetrees.
Simulation of genetic sequence alignments and estimation of timetrees
Using the true trees, we simulated genetic sequence alignments equivalent to the partial pol length (1,000 bp), and to the whole HIV-1 genome (9,719 bp) and the program Seq-Gen version 1.3.4 (Rambaut and Grassly, 1997). The simulation of sequence alignments started from a reference sequence (GenBank accession number: K03455). We used the HKY (Hasegawa-Kishino-Yano) nucleotide substitution model (Hasegawa et al., 1985) with a transition transversion rate of 8.75 and a mean substitution rate of 0.0028 per site per year which were estimated for HIV phylogenetic trees using empirical data (Patiño-Galindo and González-Candelas, 2017). Seq-Gen generates sequence alignments free from gaps and ambiguous nucleotides. We then used the simulated genetic sequence alignments to estimate maximum likelihood (ML) trees using the HKY substitution model with the program IQ-TREE version 2.2.0.3 (Minh et al., 2020) followed by the estimation of timetrees using the R package treedater version 0.5.0 (Volz and Frost, 2017) and a lognormal relaxed clock model taking into consideration the sequence alignment length and the sampling dates.
Model-based phylodynamic analysis
We carried out phylodynamic analysis using the SCM (Volz, 2012). The SCM uses a timetree that represents the evolutionary history of HIV sampled from each individual and a mathematical model to describe the transmission patterns. The SCM also assumes that each viral genetic sequence used in the timetree is linked to a trait associated with each individual and described in the mathematical model. Note that to estimate the parameter values of the epidemiological model we used a simpler representation of the more complex and realistic HIV model described in the previous sections. In this simpler model, the traits used in our mathematical model were from the following groups or compartments: I (infected individuals in region) and src (infected individuals in the global population).
For our simpler HIV mathematical model, we used a small system of ODEs to represent the dynamics of HIV infections structured into two compartments. These compartments represented the number I(t) of HIV infectious individuals in region and the number Z(t) of infected individuals receiving ART through time. We also added an additional compartment representing the number X(t) of infectious individuals in a global reservoir to account for migration of lineages to region. The X(t) compartment was modelled to have a constant effective population size with two parameters: the effective population size and the migration rate as the number of migrants per lineage per unit time. The size of X(t) grew exponentially at rate .
The rate of new infections was controlled by the parameter which specified the transmission rate by infectious individuals not receiving ART. This was represented by a piecewise linear function with changes at years 1980, 1995 and 2005. The parameter was specified as a function describing the per-capita rate for starting ART and did not account for treatment failure or loss to follow-up. The function was described by a one parameter linear function that started at zero and increased from 1995. The parameter denoted the per-capita mortality rate while the parameter m denoted the per-lineage rate of migration to region. Note that the migration rate has been specified in the ODEs as unidirectional from src to the region of interest. Furthermore, we specified migration as which means that the per lineage migration rate is constant and the per-capita migration rate varies through time. Alternatively, the per-capita rate could be constant with a variable per-lineage rate, but we elected to implement constant per-lineage rates to make results more comparable to conventional phylogeographic approaches (De Maio et al., 2015).
We also analysed whether the use of part of the tree would influence the estimates of migration rate. This was achieved by setting a specific value to the maximum height parameter available in the phydynR colik function. Maximum height allows only internode intervals in the likelihood that occur after the maximum height value before present to be used in the estimates. In our analyses, we used the whole tree (from 1980 to 2020) and maximum height set to 1990 which would estimate values for internode intervals from 1990 to 2020.
We fit the epidemiological model using the structured coalescent likelihood computed with phydynR colik function and estimated the parameter values by Markov chain Monte Carlo (MCMC) implemented in the R package BayesianTools version 0.1.8 (Volz and Siveroni, 2018). All analyses were carried out using the computing resources of the Imperial College London. For details on priors (Table S2) and MCMC analysis see Supplementary Material.
We analysed 50 replicates per combination of parameter values, each replicate was run independently twice for 24,000 iterations without thinning. Convergence of the chains to the posterior probability was assessed using the Gelman and Rubin convergence diagnostics test (Gelman and Rubin, 1992). We also calculated the effective sample sizes (ESS), which measures the efficiency of the MCMC (Nascimento et al., 2017), for all parameters and only analysed the combined log chains for which the analyses of independent runs have converged and showed ESS values greater than 200.
Additional phylodynamics and phylogeographic methods
We tested three additional methods to estimate migration rates. We used the model-based phylodynamics using PhyDyn (Volz and Siveroni, 2018) and implemented in BEAST2 (Bouckaert et al., 2019) and a discrete phylogeographic method (Lemey et al., 2009) implemented in BEAST1 (Suchard et al., 2018). For these two methods, we used the same sequence alignments generated for the phydynR analyses. Finally, we also tested a discrete phylogeographic model using ancestral character estimation (ace) (Pagel, 1994) implemented in the R package ape (Paradis et al., 2004). For this method, we used the timetree estimated for the phydynR analyses. For a complete description of these methods and implementation see the Supplementary Material.
Summary statistic
We estimated the 95% equal-tail credible interval (CI) using the posterior probability for migration rate estimated with phydynR after removing ca. 20% of initial runs as burn-in and compared results with the true value of migration rate used in the simulation of phylogenetic trees.
Using the 95% CI we calculate coverage, precision and accuracy. Coverage was defined as the percentage of replicates that contained the true migration rate value within the 95% CI. Precision was defined as the difference between the CI upper and lower bound divided by the true migration rate which would give the width of the CI; values close to zero show the estimates were very precise. Accuracy was measured using the relative error and defined as the absolute value of the difference between the 95% CI median and the true migration rate value divided by the true migration rate value. A relative error value close to zero shows that the median estimate was close to the true migration rate value.
Code availability
All scripts used to simulate and analyze our data is available at https://github.com/thednainus/migrations
Results
Model calibration and fit to surveillance data
Figure 1 shows the simulated trajectory for the incidence of diagnosis using the best combination of parameter values obtained with trajectory matching. The simulated data showed a lower number of new HIV diagnoses than the surveillance data for MSM in San Diego. Furthermore, the peak of the incidence of diagnosis happened roughly at a similar time as observed for the surveillance data (Figure 1).
Figure 1. Incidence of diagnosis.

Case numbers for incidence of diagnosis (y-axis) from 1980 to 2020 (x-axis) for the simulated data (green solid line) that showed the best fit to the surveillance data of incidence of diagnosis for MSM in San Diego (red solid line).
Estimation of migration rates using phydynR
We analysed an average of 46 replicates for a total of 48 combination of data that included (1) four different sample sizes of 200 individuals (100 in region and 100 in src); 600 individuals (300 in region and 300 in src); 1,100 individuals (1,000 in region and 100 in src); and 1,500 individuals (1,000 in region and 500 in src); (2) two sequence alignment lengths equivalent to the HIV partial pol gene and the complete HIV genome; (3) two tree sizes: the complete phylogenetic tree and partial tree by setting a maximum height to 1990 (see methods); and (4) three migration rates of 0.03; 0.1; and 0.33 rate per lineage per year of migration from src to region.
In general, analyses using a maximum height of 1990 showed that the Gelman and Rubin convergence diagnostics test was close to 1, suggesting that the independent runs converged to the same posterior distributions for all parameters. On the other hand, analyses carried out with the whole trees and alignments equivalent to the partial pol gene were more likely to show convergence problems showing high ESS values for all parameters for the independent runs, but the Gelman and Rubin convergence diagnostic was higher than one. This was particularly prominent when estimating the higher migration rates.
For details on how many replicates were used for estimation of coverage, precision and relative error see Supplementary Materials.
Coverage
When analyzing the percentage of the 95% CI that would contain the true estimate for migration rate, we observed that, in general, coverage was equal or close to 100% when estimating the highest migration rate, independent of the data used (Figure 2). Coverage was equal or close to zero when estimating the lowest migration rate. Note that we observed some coverage around or above 50% for the lowest migration rate and the smallest sample sizes of 200 or 600 individuals. However, precision suggested a large CI width (Figure 3), which could also contain the values of the other migration rates we were trying to estimate. In some situations, coverage, for the lowest migration rate, was improved by using the whole trees (Figure 2). In general, when trying to estimate the migration rate of 0.1, we observed that for genetic sequence alignments equivalent to the partial pol gene and 100 individuals in src, coverage was improved by using a maximum height of 1990 (Figure 2).
Figure 2. Coverage.

Percentage of replicates that contained the true migration rate value within the 95% credible interval for analyses carried out with whole trees and partial trees (maximum height set to 1990) and for sequence lengths equivalent to the partial pol gene and the whole HIV genome. Sample sizes are 200 individuals (100 in region and 100 in src); 600 individuals (300 in region and 300 in src); 1,100 individuals (1,000 in region and 100 in src); and 1,500 individuals (1,000 in region and 500 in src).
Figure 3. Precision.

The difference between the 95% credible interval upper and lower bound divided by the true migration rate for analyses carried out with whole trees and partial trees (maximum height set to 1990) and for sequence lengths equivalent to the partial pol gene and the whole HIV genome. Sample sizes are 200 individuals (100 in region and 100 in src); 600 individuals (300 in region and 300 in src); 1,100 individuals (1,000 in region and 100 in src); and 1,500 individuals (1,000 in region and 500 in src). The y-axis shows the 95% credible interval for the replicates analysed.
Precision
To understand how precise our estimates were, we plotted the 95% CI for the replicates analysed. It was clear that precision was influenced by the sample size. Estimates were imprecise, showing a large CI width, when sample size was small (Figure 3). In fact, it was quite difficult to distinguish the three migration rates using the smallest sample size of 200 individuals (Figures S1 and S2). Precision was highly improved as we increased sample size (Figure 3). Note that we did not get good estimates of the migration rate of 0.1 when using whole trees; 1,000 individuals in region and 100 individuals in src; and alignments equivalent to the partial pol gene. However, that was fixed by increasing the sequence length to whole HIV genomes or increasing the number of individuals in src to 500 using sequence alignments either equivalent to the pol gene or whole HIV genomes (Figure S5–S8).
Accuracy
To understand how accurate our estimates were, we estimated the relative error using the 95% CI median. Accuracy was low for the lowest migration rate and improved by increasing sample size (Figure 4). These were true for any combination of data analysed. However, when using the whole trees to estimate the lowest migration rate, accuracy was, in general, worse. For estimation of migration rate of 0.1, accuracy was good when the sample size was at least 1,100 individuals, but it was worse for smaller sample sizes (Figure 4). Finally, when the migration rate was high, accuracy was, in general, good independent of the data analysed (Figure 4).
Figure 4. Accuracy.

Relative error defined as the absolute value of the difference between the 95% credible interval median and the true migration rate values divided by the true migration rate value for analyses carried out with whole trees and partial trees (maximum height set to 1990) and for sequence lengths equivalent to the partial pol gene and the whole HIV genome. Sample sizes are 200 individuals (100 in region and 100 in src); 600 individuals (300 in region and 300 in src); 1,100 individuals (1,000 in region and 100 in src); and 1,500 individuals (1,000 in region and 500 in src). The y-axis shows the 95% credible interval for the replicates analysed.
Alternative phylodynamic and phylogeographic models
Most of the other methods that we used to estimate migration rates were very computationally intensive which did not allow a full comparison with phydynR (see Supplementary Material).
For the analyses of PhyDyn in BEAST2, we were unable to generate any results (see Supplementary Material). For the discrete analyses (Lemey et al., 2009) implemented in BEAST1, we only obtained results for sample size of 200 individuals and sequence alignments equivalent to the pol gene. For those, we obtained the 95% CI and median values which were similar among them independent of the migration rate (Figure S10). Note that for BEAST analyses, we co-estimated the phylogenetic tree and the parameters (e.g. migration rates) of the model.
For analyses carried out on fixed timetrees with ace, we analysed dataset with different sample sizes: 200 individuals (100 in region and 100 in src); 600 individuals (300 in region and 300 in src); 1,100 individuals (1,000 in region and 100 in src); 1,500 individuals (1,000 in region and 500 in src); and 2,000 individuals (1,000 in region and 1,000 in src). For these analyses, we also obtained the 95% CI for the migration rate estimates (Figures S13 and S14). We were unable to distinguish any of the migration rates except for the sample size of 2,000 individuals. For this sample size, ace returned estimates in which the 95% CI did not overlap between the three different migration rates independent of the sequence alignment used to reconstruct the phylogenetic tree (Figures S13 and S14).
Differentiation between the different migration rate estimates
It was impossible to distinguish the three different migration rates using the lowest sample size of 200 individuals, which often showed a very large 95% CI. For example, when analyzing a sample size of 200 individuals and trying to estimate the lowest migration rate, often the 95% CI could also contain the other migration rates of 0.1 or 0.33. However, by increasing the sample size, we could clearly start to distinguish the three migration rates when using phydynR (see Figures S1–S8).
For analyses carried out with ace, we needed a higher number of sequences than the ones used with phydynR. We were able to start to distinguish the three migration rates when the sample size was 2,000 individuals, albeit with similar estimates ranging from approximately 0.02 to 0.03.
Discussion
We used a complex HIV epidemiological model composed of 120 compartments to simulate genetic sequence alignments that mimicked the HIV epidemic in MSM in San Diego, USA to understand inductive bias. In reality, inductive bias is an inevitable aspect of model-based inference. However, we can assess the likely magnitude of inductive bias by using a complex model to emulate real-world uncertainty about epidemiological dynamics while using a simpler model to understand whether it would generate a good estimate for migration rates. The advantage of using a simpler model is that the MCMC analyses will be less computationally intensive with the estimation of fewer parameters. For example, on average, using phydynR, an MCMC analysis carried out with the partial trees (maximum height set to 1990) and 600 sequences took an average of 24 h to complete while an MCMC analysis carried out using whole trees and 1,500 sequences took a couple of weeks to complete. In general, analyses carried out setting a maximum height value ran faster than those using the whole trees.
Model-based phylodynamics using the structured coalescent
Analysis carried out with phydynR
It is important to note that some of our analyses using 200 sequences showed high coverage. However, the 95% CI was large and could contain other of the migration rates we were trying to estimate. Furthermore, coverage was high when estimating the highest migration rate. However, approximately 25% of replicates analysed with 1,100 or 1,500 sequences to estimate the highest migration rate, suffered from convergence problems. Convergence problems were detected by comparing independent runs which showed very high Rubin and Gelman statistical values despite showing very high ESS when analyzing alignments equivalent to the partial pol gene. We suggest that for analyses of empirical data, MCMC analyses should be always ran at least twice to assess convergence of the chains.
Coverage, precision and accuracy were higher when estimating the medium and highest migration rate and using at least 1,100 sequences. For these cases we would recommend using partial trees (by setting a maximum height value) rather than whole trees as it was less computationally intensive to estimate the parameter values. This is relevant for the current advances in sequencing technologies and the abundance of sequencing data being generated for different pathogens (Hill et al., 2023).
On the other hand, coverage was close to zero when estimating the lowest migration rate for sample sizes of 200 and 600 using whole trees and for sample sizes of 1,100 and 1,500 using partial trees. Precision and accuracy values were high for sample sizes of 200 and 600 sequences suggesting large credible intervals, and inaccurate estimates (Figures 3 and 4). It was clear that by increasing sample size, precision and accuracy improved (Figures 3 and 4). Even though there was bias on the estimates using a simpler epidemiological model, we were able to clearly distinguish the three migration rates using alignments containing at least 1,100 sequences, 100 of which from a global reservoir (see Figures S5 and S6). For alignment containing 600 sequences, we started to distinguish between the highest migration rates and the others, but there were still overlapping credible intervals when comparing the replicates.
It is also expected that by increasing the sequence alignment length, we would better recover the true tree (Yebra et al., 2016). However, our analyses showed that estimation of migration rates were driven by sample size, and either alignments of 1,000 bp or 9,719 bp was, in general, able to recover good estimates for the migration rates.
Alternative phylodynamics and phylogeographic models
In general, the analyses carried out using discrete-trait substitution phylogeographic models implemented in BEAST1 were more computationally intensive than using a fixed tree and phydynR. Because of that, we were unable to carry out a comprehensive comparison with the other methods because larger sample sizes could not be explored. However, the discrete trait approach implemented in BEAST1 (Lemey et al., 2009) was not able to correctly estimate the migration rates using a small sample size of 200 individuals and sequence alignments equivalent to the partial pol gene (Figure S10). It is possible that by increasing the sample size, this phylogeographic approach would be more suitable to distinguish the different migration rates, but this could not be determined.
Analyses carried out with a fixed phylogeny and using a constant-rate discrete-trait substitution model (ace in the ape R package) seemed more promising to distinguish between high and low migration rates when using trees reconstructed with larger numbers of sequences than the ones used with the structured coalescent. However, even though the 95% CI of the ace estimates did not overlap when comparing the three migration rates, the estimates were still very close to each other (Figures S13 and S14) for a sample size of 2,000 individuals, and there remain fundamental difficulties relating the constant per-lineage substitution rates inferred by this method with the per-capita migration rates which are epidemiologically meaningful (De Maio et al., 2015).
Overall, these comparisons support the idea that separating phylogenetic and phylodynamic inference can yield robust phylogeographic estimates with HIV-1 simulated sequence data with substantial computational savings. Accounting for nonlinear dynamics and time-dependent migration rates appears to be a more important design choice for robust inference.
Limitations of our model
We estimated migration rates using a simplification of a complex epidemiological model that was used to simulate the data. It is possible that using more complex models to estimate the parameter values, we would further reduce bias on migration rate estimation. However, in this study we were interested in model specification and inductive bias which can occur if the model is misspecified or is oversimplified. In the context of our study, even though we observed bias on the migration rate estimation using a simplistic representation of the epidemiological model, we could clearly distinguish the three different migration rates when sample sizes were at least 1,100 sequences and depending on the data analysed (Figures S5–S8). Furthermore, the migration rates were estimated using a fixed phylogenetic tree and we did not take into consideration the uncertainty on the tree estimates. The co-estimation of the phylogeny and the epidemiological parameters would generate more robust credible intervals using programs such as PhyDyn (Volz and Siveroni, 2018). However, these types of analyses were very computationally intensive, and we did not achieve sufficiently high ESS of the MCMC chains for the sample sizes analysed in this study to allow a full comparison with the analysis carried out with the fixed trees (see Supplementary Material).
Our sequence alignments were free from recombination or gaps. We have also reconstructed the ML tree using the same substitution model used to simulate the sequence alignments. If alignments are sufficiently large, we can recover the true tree (Yebra et al., 2016). Our simulations represented the best case scenario, and we did not take into consideration the misspecification of the substitution model when estimating the ML trees.
Conclusion
Estimation of migration rates are relevant for public health to prioritize actions. International migrants may have less access to health care and treatment (Baker et al., 2022) and if we can estimate that certain areas’ migration rates are high, resources can be allocated to identify and treat individuals upon arrival. However, the definition of migration is quite broad as it can be permanent or temporary and, be driven by economic, political or environmental factors (Baker et al., 2022; Deane et al., 2010). Although, based on our analyses, we would be unable to distinguish the different types of migrations (i.e. permanent or temporary), our results would still be useful to estimate migration rate in a region of interest, such as recent HIV analyses in Uganda (Grabowski et al., 2014; Ratmann et al., 2020).
Understanding regional migration is also important to optimize prevention efforts. An HIV study that used spatial dynamics of transmissions, phylodynamics and egocentric transmission models found evidence that HIV transmission coming from outside the Rakai District in Uganda were frequent and probably contributed to sustaining ongoing HIV incidence (Grabowski et al., 2014). Migration analyses can highlight whether a particular source populations may be driving a regional epidemic. Another study that integrated phylogenetics and migration data, showed that HIV acquisition in the mainland southern Uganda was primarily not related to the Lake Victoria fishing communities, which is a known high HIV prevalence area (Ratmann et al., 2020). In addition, analysis of migration data from the European surveillance system suggested that the probability of acquiring HIV in the country of origin were more than 60% for individuals originating from Africa and Europe and approximately 55% for individuals originating from Asia or other regions (Pantazis et al., 2021).
Phylogeographic analysis can also help with understanding of how effective prevention efforts are in a particular region. Estimating which proportion of new diagnoses in the region have been imported from outside that region can provide confidence that local interventions are effective, and incident diagnoses are not as likely to have resulted from local transmission. Finally, results obtained with the partial pol gene, which is highly available in empirical dataset, were, in general, effective in recovering the true migration rates.
Supplementary Material
Acknowledgements
The full SESAME research team guided development of these analyses including: Jeremy Sugarman, Gail Geller, Janesse Brewer, John Bridges, Juli Bollinger, Travis Sanchez, Anne Schuster, and Leslie Meltzer. This research was carried out using resources provided by the Research Computing Service facilities of the Imperial College London.
Funding
This study was supported by NIH MH124590, AI106039, MH100974, and by the James B. Pendleton Charitable Trust.
References
- Baker RE, Mahmud AS, Miller IF, Rajeev M, Rasambainarivo F, Rice BL, Takahashi S, Tatem AJ, Wagner CE, Wang L-F, Wesolowski A, Metcalf CJE, 2022. Infectious disease in an era of global change. Nat. Rev. Microbiol 20, 193–205. 10.1038/s41579-021-00639-z [DOI] [PMC free article] [PubMed] [Google Scholar]
- Beerli P, Felsenstein J, 2001. Maximum likelihood estimation of a migration matrix and effective population sizes in n subpopulations by using a coalescent approach. Proc. Natl. Acad. Sci. U. S. A 98, 4563–4568. 10.1073/pnas.081068098 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bouckaert R, Vaughan TG, Barido-Sottani J, Duchêne S, Fourment M, Gavryushkina A, Heled J, Jones G, Kühnert D, De Maio N, Matschiner M, Mendes FK, Müller NF, Ogilvie HA, du Plessis L, Popinga A, Rambaut A, Rasmussen D, Siveroni I, Suchard MA, Wu C-H, Xie D, Zhang C, Stadler T, Drummond AJ, 2019. BEAST 2.5: An advanced software platform for Bayesian evolutionary analysis. PLoS Comput. Biol 15, e1006650. 10.1371/journal.pcbi.1006650 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Carnell R, 2022. lhs: Latin Hypercube Samples. R package. [Google Scholar]
- Cori A, Pickles M, van Sighem A, Gras L, Bezemer D, Reiss P, Fraser C, 2015. CD4+ cell dynamics in untreated HIV-1 infection: overall rates, and effects of age, viral load, sex and calendar time. AIDS Lond. Engl 29, 2435–2446. 10.1097/QAD.0000000000000854 [DOI] [PMC free article] [PubMed] [Google Scholar]
- De Maio N, Wu C-H, O’Reilly KM, Wilson D, 2015. New Routes to Phylogeography: A Bayesian Structured Coalescent Approximation. PLoS Genet. 11, e1005421. 10.1371/journal.pgen.1005421 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Deane KD, Parkhurst JO, Johnston D, 2010. Linking migration, mobility and HIV. Trop. Med. Int. Health TM IH 15, 1458–1463. 10.1111/j.1365-3156.2010.02647.x [DOI] [PubMed] [Google Scholar]
- Dennis AM, Herbeck JT, Brown AL, Kellam P, de Oliveira T, Pillay D, Fraser C, Cohen MS, 2014. Phylogenetic studies of transmission dynamics in generalized HIV epidemics: an essential tool where the burden is greatest? J. Acquir. Immune Defic. Syndr 67, 181–195. 10.1097/QAI.0000000000000271 [DOI] [PMC free article] [PubMed] [Google Scholar]
- du Plessis L, Stadler T, 2015. Getting to the root of epidemic spread with phylodynamic analysis of genomic data. Trends Microbiol. 23, 383–386. 10.1016/j.tim.2015.04.007 [DOI] [PubMed] [Google Scholar]
- Gelman A, Rubin DB, 1992. Inference from iterative simulation using multiple sequences. Stat. Sci 7, 457–511. [Google Scholar]
- Grabowski MK, Lessler J, Redd AD, Kagaayi J, Laeyendecker O, Ndyanabo A, Nelson MI, Cummings DAT, Bwanika JB, Mueller AC, Reynolds SJ, Munshaw S, Ray SC, Lutalo T, Manucci J, Tobian AAR, Chang LW, Beyrer C, Jennings JM, Nalugoda F, Serwadda D, Wawer MJ, Quinn TC, Gray RH, Rakai Health Sciences Program, 2014. The role of viral introductions in sustaining community-based HIV epidemics in rural Uganda: evidence from spatial clustering, phylogenetics, and egocentric transmission models. PLoS Med. 11, e1001610. 10.1371/journal.pmed.1001610 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hasegawa M, Kishino H, Yano T, 1985. Dating of the human-ape splitting by a molecular clock of mitochondrial DNA. J. Mol. Evol 22, 160–174. 10.1007/BF02101694 [DOI] [PubMed] [Google Scholar]
- Hill V, Githinji G, Vogels CBF, Bento AI, Chaguza C, Carrington CVF, Grubaugh ND, 2023. Toward a global virus genomic surveillance network. Cell Host Microbe 31, 861–873. 10.1016/j.chom.2023.03.003 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hudson RR, 1990. Gene genealogies and the coalescent process. Oxf. Surv. Evol. Biol 7, 1–44. [Google Scholar]
- Jorgensen D, Pons-Salort M, Grassly NC, 2023. A simple correction to adjust for sampling biases in phylogeographic discrete trait analysis. 10.1101/2023.11.21.568020 [DOI] [Google Scholar]
- King AA, Lin Q, Ionides EL, 2022. Markov genealogy processes. Theor. Popul. Biol 143, 77–91. 10.1016/j.tpb.2021.11.003 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kühnert D, Stadler T, Vaughan TG, Drummond AJ, 2016. Phylodynamics with migration: A computational framework to quantify population structure from genomic data. Mol. Biol. Evol 33, 2102–2116. 10.1093/molbev/msw064 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Le Vu S, Ratmann O, Delpech V, Brown AE, Gill ON, Tostevin A, Fraser C, Volz EM, 2018. Comparison of cluster-based and source-attribution methods for estimating transmission risk using large HIV sequence databases. Epidemics 23, 1–10. 10.1016/j.epidem.2017.10.001 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Lemey P, Rambaut A, Drummond AJ, Suchard MA, 2009. Bayesian phylogeography finds its roots. PLoS Comput. Biol 5, e1000520. 10.1371/journal.pcbi.1000520 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Minh BQ, Schmidt HA, Chernomor O, Schrempf D, Woodhams MD, von Haeseler A, Lanfear R, 2020. IQ-TREE 2: New models and efficient methods for phylogenetic inference in the genomic era. Mol. Biol. Evol 37, 1530–1534. 10.1093/molbev/msaa015 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Müller NF, Rasmussen D, Stadler T, 2018. MASCOT: parameter and state inference under the marginal structured coalescent approximation. Bioinforma. Oxf. Engl 34, 3843–3848. 10.1093/bioinformatics/bty406 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Nascimento FF, dos Reis M, Yang Z., 2017. A biologist’s guide to Bayesian phylogenetic analysis. Nat. Ecol. Evol 1, 1446. 10.1038/s41559-017-0280-x [DOI] [PMC free article] [PubMed] [Google Scholar]
- Pagel M, 1994. Detecting correlated evolution on phylogenies: A general method for the comparative analysis of discrete characters. Proc. R. Soc. B Biol. Sci 255, 37–45. [Google Scholar]
- Pantazis N, Rosinska M, van Sighem A, Quinten C, Noori T, Burns F, Cortes Martins H, Kirwan PD, O’Donnell K, Paraskevis D, Sommen C, Zenner D, Pharris A, 2021. Discriminating Between Premigration and Postmigration HIV Acquisition Using Surveillance Data. J. Acquir. Immune Defic. Syndr 1999 88, 117–124. 10.1097/QAI.0000000000002745 [DOI] [PubMed] [Google Scholar]
- Paradis E, Claude J, Strimmer K, 2004. APE: Analyses of phylogenetics and evolution in R language. Bioinformatics 20, 289–290. 10.1093/bioinformatics/btg412 [DOI] [PubMed] [Google Scholar]
- Patiño-Galindo JÁ, González-Candelas F, 2017. The substitution rate of HIV-1 subtypes: a genomic approach. Virus Evol. 3, vex029. 10.1093/ve/vex029 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Popinga A, Vaughan T, Stadler T, Drummond AJ, 2015. Inferring epidemiological dynamics with bayesian coalescent inference: The merits of deterministic and stochastic models. Genetics 199, 595–607. 10.1534/genetics.114.172791 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Pybus OG, Fraser C, Rambaut A, 2013. Evolutionary epidemiology: preparing for an age of genomic plenty. Philos. Trans. R. Soc. B Biol. Sci 368, 20120193. 10.1098/rstb.2012.0193 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Rambaut A, Grassly NC, 1997. Seq-Gen: an application for the Monte Carlo simulation of DNA sequence evolution along phylogenetic trees. Comput. Appl. Biosci. CABIOS 13, 235–238. 10.1093/bioinformatics/13.3.235 [DOI] [PubMed] [Google Scholar]
- Rasmussen DA, Volz EM, Koelle K, 2014. Phylodynamic inference for structured epidemiological models. PLoS Comput. Biol 10, e1003570. 10.1371/journal.pcbi.1003570 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ratmann O, Kagaayi J, Hall M, Golubchick T, Kigozi G, Xi X, Wymant C, Nakigozi G, Abeler-Dörner L, Bonsall D, Gall A, Hoppe A, Kellam P, Bazaale J, Kalibbala S, Laeyendecker O, Lessler J, Nalugoda F, Chang LW, de Oliveira T, Pillay D, Quinn TC, Reynolds SJ, Spencer SEF, Ssekubugu R, Serwadda D, Wawer MJ, Gray RH, Fraser C, Grabowski MK, Rakai Health Sciences Program and the Pangea HIV Consortium, 2020. Quantifying HIV transmission flow between high-prevalence hotspots and surrounding communities: a population-based study in Rakai, Uganda. Lancet HIV 7, e173–e183. 10.1016/S2352-3018(19)30378-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Smith RA, Ionides EL, King AA, 2017. Infectious disease dynamics inferred from genetic data via sequential Monte Carlo. Mol. Biol. Evol 34, 2065–2084. 10.1093/molbev/msx124 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stadler T, Bonhoeffer S, 2013. Uncovering epidemiological dynamics in heterogeneous host populations using phylogenetic methods. Philos. Trans. R. Soc. B Biol. Sci 368, 20120198–20120198. 10.1098/rstb.2012.0198 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stein M, 1987. Large sample properties of simulations using Latin hypercube sampling. Technometrics 29, 143–151. 10.2307/1269769 [DOI] [Google Scholar]
- Suchard MA, Lemey P, Baele G, Ayres DL, Drummond AJ, Rambaut A, 2018. Bayesian phylogenetic and phylodynamic data integration using BEAST 1.10. Virus Evol. 4, vey016. 10.1093/ve/vey016 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Vaughan TG, Kühnert D, Popinga A, Welch D, Drummond AJ, 2014. Efficient Bayesian inference under the structured coalescent. Bioinforma. Oxf. Engl 30, 2272–2279. 10.1093/bioinformatics/btu201 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Vaughan TG, Leventhal GE, Rasmussen DA, Drummond AJ, Welch D, Stadler T, 2019. Estimating epidemic incidence and prevalence from genomic data. Mol. Biol. Evol 36, 1804–1816. 10.1093/molbev/msz106 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Volz E, 2017. phydynR: Phylogenetic dating and phylodynamic inference by sequential Monte Carlo. [Google Scholar]
- Volz EM, 2012. Complex population dynamics and the coalescent under neutrality. Genetics 190, 187–201. 10.1534/genetics.111.134627 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Volz EM, Frost SDW, 2017. Scalable relaxed clock phylogenetic dating. Virus Evol. 3, vex025. 10.1093/ve/vex025 [DOI] [Google Scholar]
- Volz EM, Siveroni I, 2018. Bayesian phylodynamic inference with complex models. PLOS Comput. Biol 14, e1006546. 10.1371/journal.pcbi.1006546 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Yebra G, Hodcroft EB, Ragonnet-Cronin ML, Pillay D, Brown AJL, PANGEA_HIV Consortium, ICONIC Project, 2016. Using nearly full-genome HIV sequence data improves phylogeny reconstruction in a simulated epidemic. Sci. Rep 6, 39489. 10.1038/srep39489 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
