5.13 Changes in AF over generations
Try increasing the number of generations we run the simulation for. What patterns of change do you observe in the allele frequencies?
Ne <- 100
freq <- 0.5
for (i in 1:20) {
new_freq <- rbinom(n = 1, size = Ne, prob = freq) / Ne
print(new_freq)
freq <- new_freq
}
## [1] 0.53
## [1] 0.44
## [1] 0.41
## [1] 0.48
## [1] 0.55
## [1] 0.49
## [1] 0.5
## [1] 0.5
## [1] 0.44
## [1] 0.48
## [1] 0.51
## [1] 0.46
## [1] 0.45
## [1] 0.48
## [1] 0.46
## [1] 0.51
## [1] 0.55
## [1] 0.58
## [1] 0.54
## [1] 0.56
The allele frequency starts approaching either 0 or 1.