Both simulators are included as engines for easy-to-use stdpopsim library
*from Portik et al. 2017
Derived allele is a new allele formed by mutation.
Site frequency spectrum (SFS) of P populations is the joint distribution of the derived allele frequencies of a given set of loci (SNP’s) across P populations.
$\psi_i$ — the probability to choose $A$ if its frequency is $i$
$$\footnotesize \text{e.g.}\quad \psi_i = \frac{i}{2N}, \quad \text{for constant pop. size } 2N$$
Wright-Fisher model: $X(t)$ — Markov chain with binomial transition:
$$\footnotesize P\left(X(t+1) = \frac{j}{2N} \biggr\rvert X(t) = \frac{i}{2N}\right) = \binom{2N}{j} (\psi_i)^j (1-\psi_i)^{2N - j} $$
Expected SFS:
$$SFS[d] = \sum_{i=0}^{2N} \binom{n}{d} \psi_i^d (1-\psi_i)^{n-d} P(2N \cdot X(T)= i))$$
$p(\tau, x, y)$ satisfies diffusion equation:
$$\frac{\partial}{\partial \tau}p(\tau, x, y) = \frac{1}{2} \frac{\partial^2}{{\partial y}^2} \left[b(y)p(\tau, x, y)\right] - \frac{\partial}{\partial y} \left[a(y) p(\tau, x, y)\right]$$Expected SFS:
$$SFS[d] = \int_{i=0}^{2N} \binom{n}{d} x^d (1-x)^{n-d} p(T, x) dx$$
*from Blischak et al. 2023
Using simulations with SLiM:
Using demographic inference with moments: