  Statistical inference about the speciation process has often been based on
the isolation-with-migration (IM) model, especially when the research aim is to
learn about the presence or absence of gene flow during divergence. The
generalised IM model introduced in this paper extends both the standard
two-population IM model and the isolation-with-initial-migration (IIM) model,
and encompasses both these models as special cases. It can be described as a
two-population IM model in which migration rates and population sizes are
allowed to change at some point in the past. By developing a maximum-likelihood
implementation of this GIM model, we enable inference on both historical and
contemporary rates of gene flow between two closely related species. Our method
relies on the spectral decomposition of the coalescent generator matrix and is
applicable to data sets consisting of the numbers of nucleotide differences
between one pair of DNA sequences at each of a large number of independent
loci.
