Let's consider that the effective population was of size 10 except between 2000 and 2010 when it was of size 1 (bottleneck model). Ten samples per year are taken at uniform timepoints between 1990 and 2020. We can simulate such a phylogeny using:

library(ape)
library(mlesky)
set.seed(0)
alphaFun=function(x){if (x<2000 || x>2010) 10 else 1}
sampleDates=seq(1990,2020,0.1)
t=simCoal(sampleDates,alphaFun)
plotBoth(t,alphaFun)

We now infer the past population size given the phylogeny:

fit=mlskygrid(t,res=NULL,tau=NULL,tau_lower = 1,tau_upper = 10000,ncpu=2)
plot(fit)

Parametric bootstrap:

par <- parboot(fit)
plot(par)


emvolz-phylodynamics/mlesky documentation built on Feb. 13, 2025, 1:47 p.m.