Coalescent Theory and Demography

Madagascar Workshop on Conservation Genetics and Landscape Sustainability

George P. Tiley

6 October 2026

Review

  • You have discussed estimating expected heterozygosity \(H_e\) and determining if observed heterozygosity \(H_o\) is different.
  • New mutations arise at rate \(\mu\) per site per generation, and the effective population size \(N_e\) sets the strength of drift.
  • Sometimes, population structure and non-selective forces (demography) causes differences between expected and observed variation under simple assumptions.
  • We can use expectations under complex coalescent models to reconstruct evolutionary history.

Learning objectives

  • Convince ourselves that \(\pi = \theta_W = \theta = 4N_e\mu\) under neutrality and a constant \(N_e\).
  • Build the site frequency spectrum (SFS) from a sample and state its neutral expectation \(\mathbb E[\xi_i]=\theta/i\).
  • Interpret the sign of Tajima’s \(D\).
  • Explain why demography is genome-wide but selection is local and how that can be useful in practice.
  • Read a joint SFS for two or more populations, predict how split time, gene flow, and size change shape it.
  • Compare demographic models with likelihood and AIC, and convert estimates into population size and years.

Moving from the modern synthesis to neutral theory and the coalescent

  • Modern synthesis: evolution is driven by selection on phenotypes. Prior to molecular data.
  • Neutral theory: most evolutionary change at the molecular level is due to genetic drift of neutral mutations.
  • Coalescent theory: a model to develop expectations for genetic variation consistent with neutral theory.
Foundational scientists to modern thinking on selection versus stochastic processes in molecular evolution.

Foundational scientists to modern thinking on selection versus stochastic processes in molecular evolution

Core results from neutral theory

\[\theta = 4N_e\mu\]

Where \(\theta\) is the expected number of differences (per site) between two sequences sampled from the population. \(N_e\) is the effective population size, and \(\mu\) is the mutation rate per site per generation. The 4 sneaks in because we are considering diploid organisms. If we had a haploid population, the equation would be \(\theta = 2N_e\mu\).

\(\pi\) is an estimator of \(\theta\) based on pairwise differences.

\(\theta_W\) is an estimator of \(\theta\) based on the number of segregating sites.

Core results from neutral theory

We often try to distinguish mutations from substitutions. A mutation is a change in the DNA sequence that occurs in an individual, while a substitution is a mutation that has become fixed in a population.

The neutral theory predicts that the substitution rate \(\rho\) is equal to the mutation rate \(\mu\) and is independent of population size.

Let \(\mu\) be the mutation rate per site per generation, then the average number of new mutations per generation is \(2N\mu\) in a diploid population.

The probability that a new mutation fixes is \(1/(2N)\) - we are ignoring selection and assuming all mutations have and equally likely chance of not drifting to extinction.

So the substitution rate is:

\[\rho = 2N\mu \times \frac{1}{2N} = \mu\]

The coalescent for a single population

A sample in the present

A sample of 10 individuals in the present, \(t_0\).

Time runs left to right, into the past.

A single vertical column of ten filled circles representing ten sampled individuals in the present generation.

One generation back

Each individual draws a parent uniformly at random from the previous generation, independently of every other individual.

This generational sampling assumption is the Wright-Fisher model. It would be appropriate for a monoecious annual plant population.

Two columns of ten circles with thin lines connecting each individual in the present to a randomly chosen parent in the previous generation.

Two alleles that share a parent

\[P(\text{share an ancestor 1 generation ago}) = \frac{1}{2N}\]

The first allele picks some parent; the second picks the same one with probability \(1/2N\).

Two highlighted individuals in the present generation both connecting to the same highlighted parent one generation back.

Two alleles that do not

\[P(\text{do not share an ancestor}) = 1 - \frac{1}{2N}\]

Two highlighted individuals in the present generation connecting to two different highlighted parents one generation back.

Following two lineages back

A ten-by-ten Wright-Fisher pedigree with two lineages highlighted in red, traced from the present back through nine generations until they meet at a common ancestor.

Waiting for the first coalescence

\(P(\text{two alleles coalesce in generation } i \mid N)\)

\[P(t=i) = \left( 1 - \frac{1}{2N} \right)^{i-1}\left( \frac{1}{2N} \right)\]

The same ten-by-ten pedigree with two lineages traced back to their common ancestor.

That is a geometric distribution

Geometric with \(p = 1/2N\):

\[P(t \mid N) = \left( 1 - \frac{1}{2N} \right)^{i-1}\left( \frac{1}{2N} \right)\]

\[\boxed{\;\mathbb{E}[t] = \frac{1}{p} = 2N\;}\]

Wright-Fisher pedigree with two traced lineages coalescing.

Not coalescing for a while

\(P(\text{two alleles do not coalesce in } i \text{ generations})\)

\[P(t > i) = \left( 1 - \frac{1}{2N} \right)^{i}\]

An exponential approximation

\[P(t > i) = \left( 1 - \frac{1}{2N} \right)^{i}\]

Since \(\left( 1 - \frac{1}{2N} \right) \approx e^{-\frac{1}{2N}}\), \(\qquad P(t > i) \approx e^{-\frac{i}{2N}}\)

Rescaling time

\[P(t > i) \approx e^{-\frac{i}{2N}} \approx e^{-T}\]

Measuring time in units of \(2N\) generations removes \(N\) from the expression entirely.

Coalescent units

\[P(t > i) \approx e^{-T}\]

\[T = \frac{\text{number of generations}}{2N}\]

One coalescent unit \(=2N\) generations.

What about more than two alleles?

More than two alleles

Everything so far followed a pair. A real sample has \(n\) lineages, and any pair of them can coalesce.

Two highlighted individuals connecting to two different parents one generation back.

One lineage

Ten-by-ten Wright-Fisher pedigree with a single lineage highlighted from the present back to the founding generation.

Two lineages

The same pedigree with a second lineage highlighted, the two meeting at a common ancestor part-way back.

Three lineages

The same pedigree with three lineages highlighted, coalescing at two different times: three lineages become two, and later two become one.

Three alleles, one generation

\(P(\text{3 alleles do not coalesce in 1 generation})\)

\[= \left( 1 - \frac{1}{2N} \right) \times \left( 1 - \frac{2}{2N} \right)\]

The second lineage must miss the first; the third must miss both.

Two alleles

\(P(\text{2 alleles do not coalesce in 1 generation})\)

\[= 1 - \frac{1}{2N}\]

Two highlighted individuals connecting to two different parents one generation back.

Three alleles

\(P(\text{3 alleles do not coalesce in 1 generation})\)

\[= \left( 1 - \frac{1}{2N} \right) \times \left( 1 - \frac{2}{2N} \right)\]

Three highlighted individuals in the present generation connecting to three different highlighted parents one generation back.

\(n\) alleles

\(P(n \text{ alleles do not coalesce in 1 generation})\)

\[= \left( 1 - \frac{1}{2N} \right) \times \left( 1 - \frac{2}{2N} \right) \times \cdots \times \left( 1 - \frac{n-1}{2N} \right)\]

Three highlighted individuals connecting to three different parents one generation back.

Dropping the small terms

  • Expanding the product leaves terms that look like \(1/N\) terms that have \(1/N^2\).
  • Because we expect \(n \ll N\), we can drop the terms that have \(1/N^2\) from the expansion.

\[1 - \sum_{i=1}^{n-1}\frac{i}{2N} + \sum_{i<j}\frac{i}{2N}\cdot\frac{j}{2N} - \cdots\]

\[\approx 1 - \frac{1 + 2 + \cdots + (n-1)}{2N}\]

The complement

\[P(n \text{ alleles do}) = 1 - P(n \text{ alleles do not})\]

\[= \frac{1 + 2 + \cdots + (n-1)}{2N}\]

Three highlighted individuals connecting to three different parents one generation back.

Summing the series

Given: \[ 1 + 2 + \cdots + (n-1) = \frac{n(n-1)}{2}, \] \[P(n \text{ alleles do}) = \frac{n(n-1)}{4N}\]

Waiting time for \(n\) alleles

We can now develop an expression for the probability that \(n\) alleles coalesce in an arbitrary generation:

\[ P(n \text{ alleles coalesce in the } i\text{th generation}) \]

\[= \left[ 1 - \frac{n(n-1)}{4N} \right]^{i-1} \frac{n(n-1)}{4N}\]

Geometric again

This fits nicely into the expectation of a geometric distribution again. So, the expected waiting time is the reciprocal of the success probability:

\[\boxed{\;\mathbb{E}[t] = \frac{4N}{n(n-1)}\;}\]

The combinatoric form

\(\frac{n(n-1)}{2}\) is the number of pairs, so the same result can be written as:

\[= \left[ 1 - \binom{n}{2}\left( \frac{1}{2N} \right) \right]^{i-1} \binom{n}{2}\frac{1}{2N}\]

Each of the \(\binom{n}{2}\) pairs coalesces at rate \(1/2N\).

Expectation, combinatoric form

\[\mathbb{E}[t] = \frac{2N}{\binom{n}{2}}\]

Identical to \(4N/n(n-1)\) — the pair-counting view just makes the mechanism explicit.

Three highlighted individuals connecting to three different parents one generation back.

To continuous time

As before, the geometric waiting time is well approximated by an exponential once \(N\) is large.

Three highlighted individuals connecting to three different parents one generation back.

The per-pair rate

A single pair coalesces at rate

\[T = \frac{1}{2N}\]

per generation.

Three highlighted individuals connecting to three different parents one generation back.

Counting the ways

There are \(n-1\) coalescent events to get from \(n\) lineages to one, and \(\binom{n}{2}\) ways for the next one to happen.

Three highlighted individuals connecting to three different parents one generation back.

The \(j\)th coalescence

With \(\binom{j}{2} = \frac{j(j-1)}{2}\) pairs available when \(j\) lineages remain:

\[f(T_j) = \frac{j(j-1)}{2}\exp\left\{ -\frac{j(j-1)}{2}T_j \right\}\]

Three highlighted individuals connecting to three different parents one generation back.

All coalescences on a genealogy \(G\)

The intervals are independent, so the density of the whole set of waiting times is a product:

\[f(T \mid G) = \prod_{j=2}^{n} \frac{j(j-1)}{2}\exp\left\{ -\frac{j(j-1)}{2}T_j \right\}\]

Expectations for the TMRCA

Each interval is exponential, so its expectation is the reciprocal of its rate:

\[\mathbb{E}[T_j] = \frac{2}{j(j-1)}\]

and the time to the most recent common ancestor is the sum of the intervals:

\[\mathbb{E}[T_{MRCA}] = \mathbb{E}(T_n + T_{n-1} + \cdots + T_2)\]

Collapsing the sum

\[\mathbb{E}[T_{MRCA}] = \sum_{j=2}^{n} \frac{2}{j(j-1)} = 2\sum_{j=2}^{n}\left( \frac{1}{j-1} - \frac{1}{j} \right)\]

The sum telescopes:

\[\mathbb{E}[T_{MRCA}] = 2\left( 1 - \frac{1}{n} \right) \approx 2 \;\text{ coalescent units } = 4N \text{ generations}\]

Important conclusion

\(\mathbb{E}[T_{MRCA}] converges to 2\) coalescent units as \(n\) grows

This means that adding more samples does not add much information about deeper coalescent events. Ten lineages should already capture \(2(1-1/10)=1.8\) of the maximum 2.

Watterson’s \(\theta\)

From waiting times to branch length

So far we have the depth of the tree. That can be useful for estimating split times for speciation later on, but for now we only care about counting segregating sites. They occur on branches, so what we need is total branch length.

While \(j\) lineages remain, there are \(j\) branches accumulating length, each for a duration \(T_j\). So

\[\mathbb{E}[L] = \sum_{j=2}^{n} j \; \mathbb{E}[T_j]\]

This takes the form of the nth coalescent before.

The sum collapses again

Substituting \(\mathbb{E}[T_j] = \dfrac{4N}{j(j-1)}\) generations:

\[\mathbb{E}[L] = \sum_{j=2}^{n} j \times \frac{4N}{j(j-1)} = 4N\sum_{j=2}^{n} \frac{1}{j-1} = 4N\sum_{i=1}^{n-1} \frac{1}{i}\]

\[\boxed{\;\mathbb{E}[L] = 4N a_n, \qquad a_n = \sum_{i=1}^{n-1}\frac{1}{i}\;}\]

The \(j\) in the numerator cancels the \(j\) in \(j(j-1)\) — more lineages means more branches, but proportionally shorter intervals.

\(a_n\) grows like \(\log n\)

  • Here \(n\) is logarithmic on the x axis, \(a_n\) is linear on the y axis.
  • Going from \(n=2\) to \(n=10\) nearly triples the tree length.
  • Going from \(n=10\) to \(n=200\) — twenty times the sequencing — only doubles it.

Thus, we do not emphasize sampling many individuals within a population.

The harmonic number a-n plotted against sample size on a logarithmic x axis, forming a straight line from about 1 at n equals 2 to about 5.9 at n equals 200.

Mutations land on the tree

Under the infinite-sites model, mutations arrive along branches at rate \(\mu\) per generation, independently of the genealogy.

So the number of segregating sites is just a thinned version of the total branch length:

\[\mathbb{E}[S] = \mu\,\mathbb{E}[L] = 4N\mu\,a_n\]

A coalescent genealogy of six lineages with mutations marked on the branches, coloured by how many samples each mutation is carried by.

The definition of \(\theta\)

Writing \(\theta = 4N\mu\), the population mutation parameter:

\[\boxed{\;\mathbb{E}[S] = \theta\,a_n\;}\]

\(\theta\) compounds mutation and population size. A large population mutating slowly and a small population mutating fast produce the same spectrum of variation. Your organismal expertise is needed to separate the two.

Watterson’s estimator

Rearranging \(\mathbb{E}[S] = \theta a_n\) gives an estimator you can compute from a sequence alignment (Watterson 1975):

\[\boxed{\;\hat\theta_W = \frac{S}{a_n}\;}\]

  • Unbiased by construction: \(\mathbb{E}[\hat\theta_W] = \theta\).
  • Needs only \(S\), the count of variable sites, and \(n\).
  • Per site, divide by sequence length.

The site frequency spectrum

Definition and neutral expectation

The SFS counts segregating sites by the number of copies \(i\) of the derived allele in a sample of \(n\). Under the neutral, constant-size coalescent:

\[ \boxed{\;\mathbb E[\xi_i] = \frac{\theta}{i}, \qquad i = 1, \dots, n-1\;} \]

  • A mutation on a branch subtending \(i\) tips appears \(i\) times
  • rare variants (singletons, \(i=1\)) should dominate the SFS
  • \(\pi\) and \(\theta_W\) are different summary statistics from the same SFS: \(\theta_W \propto \sum_i \xi_i\) (counts sites equally), \(\pi \propto \sum_i i(n-i)\,\xi_i\) (weights intermediate frequencies).

Definition and neutral expectation

Bar chart of the neutral site frequency spectrum where site counts fall off as one over derived-allele frequency, singletons tallest, with the theta-over-i expectation curve drawn through the bars.

Simulated: \(n=50\), 2 Mb, constant \(N_e=10^4\)

Folded vs. unfolded

  • Unfolded SFS needs an outgroup to polarize ancestral vs. derived (often difficult in practice).
  • Folded SFS uses the minor-allele count \(\eta_i = \xi_i + \xi_{n-i}\)

A complication of the unfolded SFS is that errors in polarization can create a heavy tail, which looks like a historical bottleneck or a completed selective sweep.

Polarization errors in action

  • Introduce 25% polarization error and the unfolded spectrum grows a fake high-frequency-derived tail.
  • The folded spectrum is unchanged in both panels.
Four site frequency spectra: with no polarization error and with twenty-five percent error, shown unfolded and folded. The unfolded spectrum grows a large spurious high-frequency tail under error while the two folded spectra are identical.

Tajima’s \(D\)

Construction

Both \(\pi\) and \(\theta_W\) estimate \(\theta\), so their difference reflects when evolution deviates from neutrality. Tajima (Tajima 1989) derived the standardization constant that allows the difference to be interpreted as a Z-score, where anything less than about \(-2\) or greater than about \(+2\) is a significant departure from neutrality:

\[ D = \frac{\pi - \theta_W}{\sqrt{\widehat{\mathrm{Var}}(\pi - \theta_W)}} . \]

  • \(\pi\) is affected most by intermediate-frequency variants; \(\theta_W\) counts all segregating sites.
  • So Tajima’s \(D\) asks: is the SFS skewed towards rare variants (\(\pi < \theta_W\)) or intermediate variants (\(\pi > \theta_W\))?

Interpreting the sign

\(D\) SFS shape Demographic cause (genome-wide) Selective cause (local)
\(< 0\) excess rare variants expansion — or a bottleneck it has recovered from recent sweep, purifying selection
\(\approx 0\) neutral constant size neutral
\(> 0\) excess intermediate a contraction you are still inside, structure balancing selection

“Bottleneck” is not one signature

Five site frequency spectra plotted as the ratio of observed to neutral expectation: constant size is flat at one, expansion is crowded into the rare bins, a recovered bottleneck rises toward high frequencies, an ongoing contraction ramps steadily upward, and a cyclical history is U-shaped.

20 replicates each; \(n=50\), 2 Mb.

  • Expansion and recovered bottleneck both give \(D<0\) — one population grew, the other crashed. Backwards from the present, a recovery is an expansion.
  • Only the ongoing contraction — still sitting at \(N_e/10\) — gives \(D>0\).
  • The sign of \(D\) reports the recent direction of change in \(N_e\), not whether a bottleneck ever happened.
  • Note the spread, too: the recovered bottleneck has \(\text{sd}(D)=0.60\) vs \(0.09\) for the expansion. A crash is a randomizing event — replicate genomes disagree.

Demography vs. Selection

  • Demography (bottlenecks, expansions, structure) acts on every locus — it shifts the genome-wide SFS.
  • Selection acts on specific loci and their linked neighborhoods — a local departure against the genome-wide background.
  • ⟹ Build the genome-wide distribution of \(D\) (or \(F_{ST}\)), then flag outliers.
Tajima's D in sliding windows along a five-megabase chromosome. The neutral simulation stays near zero throughout; the hard-sweep simulation tracks it everywhere except for a sharp dip to about minus 1.9 centred on the selected site.

30 replicates, 50 kb windows, \(s=0.05\). Both lines are the same demography — only the sweep differs.

Computing Tajima’s \(D\) from an SFS

The sweep signature is an SFS skewed to rare variants. Compute \(D\) directly from a folded/unfolded spectrum:

TajimaD <- function(sfs) {              # sfs = c(#singletons, #doubletons, ...)
  n  <- length(sfs) + 1                 # number of sampled chromosomes
  ss <- sum(sfs)                        # segregating sites
  a1 <- sum(1 / seq_len(n - 1)); a2 <- sum(1 / seq_len(n - 1)^2)
  b1 <- (n + 1) / (3 * (n - 1)); b2 <- 2 * (n^2 + n + 3) / (9 * n * (n - 1))
  c1 <- b1 - 1/a1; c2 <- b2 - (n + 2)/(a1 * n) + a2/a1^2
  e1 <- c1 / a1;  e2 <- c2 / (a1^2 + a2)
  theta_pi <- sum(sapply(seq_along(sfs), function(i) i*(n-i)*sfs[i])) / choose(n, 2)
  theta_w  <- ss / a1
  (theta_pi - theta_w) / sqrt(e1*ss + e2*ss*(ss-1))
}

Sweep vs. neutral — try it

sweep   <- c(20, 2, 1, 1, 1)   # rare-variant excess  → D < 0
neutral <- c( 6, 1, 2, 2, 4)   # flatter spectrum     → D ≈ 0
TajimaD(sweep)     # strongly negative
TajimaD(neutral)   # near zero
  • The sweep SFS piles up singletons ⟹ \(\pi \ll \theta_W\) ⟹ negative \(D\).
  • Change the counts and watch \(D\) move — this is the engine behind the genome scans in deck 05.
Two site frequency spectra, a sweep spectrum dominated by singletons with a strongly negative Tajima's D and a flatter neutral spectrum with D near zero.

Demographic models from the joint SFS

From one population to two

The SFS counts sites by the number of copies of an allele in one sample. The joint SFS counts them in two samples at once:

\[\xi_{i,j} = \text{number of sites with } i \text{ copies in population A and } j \text{ copies in B}\]

  • Add up over B and you get back A’s ordinary SFS: the 1D spectra are the margins.
  • Axes (\(i = 0\) or \(j = 0\)): private variants, segregating in one population only.
  • Interior: shared variants, inherited from the common ancestor or carried across by gene flow.
  • Opposite corners \((0, n_B)\) and \((n_A, 0)\): fixed differences between the populations.

What shapes a joint SFS

Four joint site frequency spectra drawn as heatmaps. A recent split keeps most sites in the interior near the diagonal. An old split leaves bright axes, bright corners and a nearly empty interior. An old split with gene flow fills the interior again. An old split with a crash in population B flattens B's axis and empties the interior.

Simulated with msprime: 10 diploids per population, \(N_e = 10^4\), 20 Mb. The recent split is 0.1 coalescent units ago; the old split is 2.

  • Recent split: frequencies have barely drifted apart, so mass stays near the diagonal.
  • Old split: shared variants drift to loss or fixation, leaving private variants and fixed differences.
  • Gene flow refills the interior, even though the split is just as old.
  • Crash in B: B’s rare variants vanish. This is the 2D version of “a contraction you are still inside”.

Folding, again

  • No outgroup: count each site by its minor allele, decided over both samples together.
  • Folding mirrors everything above the dashed line onto the triangle below it.
  • We lose “common in both” vs. “rare in both”, but the axes vs. interior contrast and the fixed differences survive.
  • Mouse lemurs have no suitable outgroup, so their spectra are folded.

The same simulated joint spectrum drawn unfolded and folded. In the folded version everything above the anti-diagonal is empty and has been added to the mirror-image cells below it.

Three populations, three pairwise spectra

  • \(K\) populations give \(\binom{K}{2}\) pairwise spectra, and fastsimcoal2 fits them all together (Excoffier et al. 2013, 2021).
  • Below: the paper’s split times and pre-crash sizes, with no recent crash; only gene flow differs.
Six joint spectra in two rows of three pairs. Without gene flow, the two Ambavala pairs have bright private axes, a dim interior and F_ST of 0.26. With ancestral gene flow, their interiors fill in and F_ST falls to 0.05. The Ambatovy-Tsinjoarivo pair barely changes.

Simulated with msprime (Baumdicker et al. 2022) on the mouse lemur north-vs-south tree. Top: no gene flow. Bottom: gene flow between Ambavala and the ancestor of the two southern populations.

The likelihood of an SFS

\[\ln L(\Theta) = \sum_{k} m_k \ln p_k(\Theta)\]

  • \(m_k\): observed number of sites in cell \(k\) of every pairwise spectrum, including monomorphic sites.
  • \(p_k(\Theta)\): probability that a site lands in cell \(k\) under parameters \(\Theta\). fastsimcoal2 estimates it by coalescent simulation, then climbs towards the best \(\Theta\).
  • Every site is counted once in each pairwise spectrum, and nearby sites are linked, so this is a composite likelihood: good for finding \(\hat\Theta\), overconfident about uncertainty.
  • Monomorphic sites plus \(\mu = 1.52\times10^{-8}\) (from a mouse lemur pedigree) turn \(\theta\) into individuals and generations; 3.5 years per generation gives years. As before: \(\theta\) compounds \(N_e\) and \(\mu\), and organismal knowledge separates them.

Case study: Goodman’s mouse lemur

  • A small, forest-dependent primate of Madagascar’s eastern rainforests and isolated Central Highland forest patches (Tiley et al. 2022).
  • Was its forest fragmented by paleoclimate (the LGM, 19–26.5 ka) or by people (~2 ka)?
  • North vs. south: Ambavala (north) vs. Ambatovy and Tsinjoarivo (south). RADseq, with spectra estimated from genotype likelihoods.
Three observed joint spectra for the pairs Ambatovy-Tsinjoarivo, Ambavala-Tsinjoarivo and Ambavala-Ambatovy, with F_ST of 0.088, 0.143 and 0.082. Each has bright private-variant axes, a well-filled interior and an empty folded triangle.

Observed folded joint spectra and Hudson’s \(F_{ST}\) for each pair.

Eleven hypotheses

Eleven small tree diagrams with Tsinjoarivo and Ambatovy joining first and Ambavala at the root. Blue arrows show which branches exchange migrants in each model; models 8 to 10 have a dashed line where gene flow changes, and model 10, shaded grey, has a red line near the present for a size change.

Blue arrows: gene flow. Dashed line: gene flow stops (models 8 and 10) or resumes (model 9). Red line: a recent size change in all three populations. Grey: the best model.

  • Built hierarchically: which branches exchanged genes, then when, then a recent size change.
  • Each model is a .tpl file (the history, written backward in time) plus an .est file (free parameters and search ranges).

Choosing among models

The Akaike information criterion (Akaike 1974) penalizes each free parameter; Akaike weights turn AIC differences into model probabilities:

\[\text{AIC} = 2k - 2\ln\hat L \qquad\qquad w_i = \frac{e^{-\Delta_i/2}}{\sum_j e^{-\Delta_j/2}}\]

A horizontal bar chart of AIC differences on a log scale. Model 10 has a difference of zero. Six models with ancestral gene flow follow 1,800 to 2,300 units behind; the four models without it are 9,000 to 25,000 units behind.

  • Model 10 wins with \(w \approx 1\): ancestral gene flow, gene flow that stopped, and a recent size change.
  • Every model with ancestral gene flow beats every model without it.
  • fastsimcoal2 reports log10 likelihoods: convert to natural logs before computing AIC.

What the best model says

Point estimates and confidence intervals on a log time axis. The north-south split is near 277 thousand years ago. The Tsinjoarivo-Ambatovy split and the end of gene flow are near 7 to 8 thousand years ago, after the Last Glacial Maximum. The size change is near 1.9 thousand years ago, inside the human-arrival band, with a confidence interval from about 100 years to 12 thousand years.

Model 10 estimates and 95% CIs from Tiley et al. (2022) (Table S15), at 3.5 years per generation.

  • North and south split ~277 ka; at the estimates, north–south gene flow ends about when Tsinjoarivo and Ambatovy split, ~7.8 ka (after the LGM).
  • A 20- to 45-fold decline in Tsinjoarivo and Ambavala ~1.9 ka, near human arrival, but the CI spans 0.1–12 ka. Ambatovy did not decline.
  • Tajima’s \(D\) tracks how small each population is now: Tsinjoarivo (smallest) \(+0.11\), Ambavala \(-0.20\), Ambatovy (no decline) \(-0.43\).

Winning is not fitting

Simulate the best model at its estimates and compare it with the data:

pair SNPs observed SNPs model 10 \(F_{ST}\) observed \(F_{ST}\) model 10
Ambatovy × Tsinjoarivo 635,232 650,040 0.088 0.083
Ambavala × Tsinjoarivo 601,392 604,415 0.143 0.133
Ambavala × Ambatovy 708,356 708,383 0.082 0.085
  • Without the crash, the same tree gives \(F_{ST} \approx 0.035\) for the two southern populations: drift in a small population drives fast differentiation.
  • AIC only ranks the models you thought of. Simulation asks whether the winner can actually produce the data.

From fastsimcoal2’s units to individuals and years

fastsimcoal2 reports what the data pin down, given the \(\mu\) fixed in the .tpl file:

fastsimcoal2 reports convert with absolute units
size \(N\) (gene copies) \(N_e = N/2\) diploid individuals
time \(T\) (generations) \(t = T \times g\) years
size and \(\mu\) \(\theta = 2N\mu = 4N_e\mu\) expected diversity per site
migration \(m\) (per lineage, per generation) \(N \times m\) migrants per generation
  • Drift is measured in coalescent units: \(T/N = T/2N_e\), as earlier in this lecture.
  • We refitted model 10 with fastsimcoal 2.8 (10 replicates; practical §9–10). Its crash is more recent than Table S15’s: 332 generations, which add 0.097 units of drift to Tsinjoarivo, more than the 4,988 generations before it (0.074).
  • Every branch is under 1 unit long, even the ~300,000-year-old one, so much ancestral variation is still shared.

Rescaling is not refitting

The SFS fixes \(N\mu\), \(T\mu\) and \(Nm\), not \(N\), \(T\) and \(m\) separately:

\[\mu \to c\,\mu \quad\Longrightarrow\quad N \to N/c, \qquad T \to T/c, \qquad m \to c\,m \qquad \text{(same likelihood)}\]

  • Unchanged: fold declines, the order of events, \(Nm\), drift in coalescent units. Changed: individuals and years, which also scale with the generation time \(g\).
Four panels of event dates against generation time, one line per mutation rate. The size change stays between about 600 and 2,300 years ago, around the human-arrival period. The Tsinjoarivo-Ambatovy split ranges from about 10,000 to 36,000 years ago, straddling the Last Glacial Maximum.

Event dates from our model-10 refit across illustrative mutation rates (lines) and generation times.

Rescaling in R

# our best model-10 replicate, exactly as fastsimcoal2 wrote it
est <- read.table("data/model10_best_fit/10.bestlhoods", header = TRUE)

mu <- 1.52e-8; g <- 3.5
est$Tau_Crash * g                     # years since the size change               ~1,160
est$Theta_NodeS / 2                   # diploid Ne of the southern ancestor       ~73,500
2 * est$Theta_NodeS * mu              # theta per site = 4 Ne mu                  ~0.0045
est$Tau_Crash / est$Theta_TsinCurr    # drift since the crash (coalescent units)  ~0.10
  • Double \(\mu\): the first two numbers halve, while \(\theta\) and the drift do not change. They are what the data measured.

Caveats

  • Composite likelihood: ~30 M linked sites make \(\Delta\)AIC and naive confidence intervals overconfident. The paper used a block bootstrap (blocks of 10,000 sites).
  • Linked selection shifts the SFS genome-wide too: background selection (Charlesworth, Morgan, and Charlesworth 1993) can mimic a change in \(N_e\). Demographic models assume neutral sites.
  • Identifiability: with biallelic SNPs, population size and split time can trade off against each other.
  • Fold consistently: the model’s spectrum must be folded exactly as the data were (e.g. within each pair, as ANGSD does; fastsimcoal2’s --foldedSFS).
  • Absolute \(N_e\) differs between methods (stairway plots vs. fastsimcoal2 in this study). Trust the pattern of change more than the exact numbers.

Key takeaways

Conceptual review

  • Under what conditions does \(\pi = \theta_W = \theta = 4N_e\mu\)?
  • What does \(\theta_W\) depend on?
  • What does Tajima’s \(D\) tell us about the skew of the SFS?
  • What is a potential risk of the unfolded SFS?
  • What are demographic scenarios where summary statistics like Tajima’s \(D\) have difficulty?
  • How would a recent split and an old split with ongoing gene flow look different in a joint SFS?
  • What additional information do you need to calibrate a demographic model to time in years?
  • If a new study revises the mutation rate, which parameter estimates change, and which stay the same?

References

Akaike, Hirotugu. 1974. “A New Look at the Statistical Model Identification.” IEEE Transactions on Automatic Control 19 (6): 716–23. https://doi.org/10.1109/TAC.1974.1100705.
Baumdicker, Franz, Gertjan Bisschop, Daniel Goldstein, Graham Gower, Aaron P Ragsdale, Georgia Tsambos, Sha Zhu, et al. 2022. “Efficient Ancestry and Mutation Simulation with Msprime 1.0.” Genetics 220 (3): iyab229. https://doi.org/10.1093/genetics/iyab229.
Charlesworth, Brian, M. T. Morgan, and Deborah Charlesworth. 1993. “The Effect of Deleterious Mutations on Neutral Molecular Variation.” Genetics 134 (4): 1289–1303. https://doi.org/10.1093/genetics/134.4.1289.
Excoffier, Laurent, Isabelle Dupanloup, Emilia Huerta-Sánchez, Vitor C Sousa, and Matthieu Foll. 2013. “Robust Demographic Inference from Genomic and SNP Data.” PLoS Genetics 9 (10): e1003905. https://doi.org/10.1371/journal.pgen.1003905.
Excoffier, Laurent, Nina Marchi, David Alexander Marques, Remi Matthey-Doret, Alexandre Gouy, and Vitor C Sousa. 2021. “Fastsimcoal2: Demographic Inference Under Complex Evolutionary Scenarios.” Bioinformatics 37 (24): 4882–85. https://doi.org/10.1093/bioinformatics/btab468.
Tajima, Fumio. 1989. “Statistical Method for Testing the Neutral Mutation Hypothesis by DNA Polymorphism.” Genetics 123 (3): 585–95. https://doi.org/10.1093/genetics/123.3.585.
Tiley, George P, Tobias van Elst, Helena Teixeira, Dominik Schüßler, Jordi Salmona, Marina B Blanco, José M Ralison, et al. 2022. “Population Genomic Structure in Goodman’s Mouse Lemur Reveals Long-Standing Separation of Madagascar’s Central Highlands and Eastern Rainforests.” Molecular Ecology 31 (19): 4901–18. https://doi.org/10.1111/mec.16632.
Watterson, G. A. 1975. “On the Number of Segregating Sites in Genetical Models Without Recombination.” Theoretical Population Biology 7 (2): 256–76. https://doi.org/10.1016/0040-5809(75)90020-9.