Closed ben18785 closed 5 years ago
We ran them on the HPC. Which we can do again. But Yule only grows linearly -- gain one individual per time step -- though, yes, it is difficult.
Looking into Models.py, I see that all generative models -- WF, Moran and Yule -- depend on Bentley.py. This appears to contain the core generative functions. But, just to be clear, this does not accumulate variants as in what we called the "Bentley" model, which is a WF model but in which you assay not just living variants but corpses, so that the assay population has N individuals x t time steps?
I ask since, although previously we looked at this, I am have now dropped this as being an obsession peculiar to archaeologists. We want, in generation, just the individuals who are alive -- who can potentially reproduce -- in that generation.
No, the counts must consist of just a single generation. That's because, as predicted by theory, the neutral WF process gives a good fit to a log series SAD rather than a power law. The NFD gives a less good fit, but that's perhaps expected. See Results Issue.
Yes, the offspring are chosen from the existing (alive) parents, not a collective of corpse variants.
Merry Christmas to you too, by the way! Were you in London for it?
On 26 Dec 2018, at 09:35, Armand1 notifications@github.com wrote:
No, the counts must consist of just a single generation. That's because, as predicted by theory, the neutral WF process gives a good fit to a log series SAD rather than a power law. The NFD gives a less good fit, but that's perhaps expected.
SADS.pdf
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
@Armand1 I have just uploaded the model code and some html documents.
Things to note:
The generating model (Python) now allows you to run it from within R. See the s_run_simulations.Rmd and s_frequencies_inference.Rmd to show you how. I thought this would, perhaps, be easier for doing more simulations on the supercomputer since you (I think?) are more familiar with R than Python.
The code provides separate functions to run each of the three pop gen models: WrightFisherRun, MoranRun and YuleRun. Each of these takes the same parameters. To make the generations comparable amongst the three processes, for each generation, I run the Moran and Yule processes through the whole population. For example, suppose the initial population is of size 10. Then for each generation of Moran, I run the Moran process (select one randomly to reproduce, kill another randomly) 10 times, resulting in a population of the same size. For the Yule, I run the Yule process (select one randomly to reproduce) 10 times, resulting in a population of size 20.
The Yule process, as I'm sure you know, is prohibitive to run for even modest population sizes, since it grows exponentially over time. I'm not sure how you ran this previously?
In s_frequencies_inference.html, you should see how I can retrieve the parameters via inference used to simulate the Wright-Fisher model. For Moran and Yule, the inference process is much more complex and I'm not sure how to fit the data (other than use the WF statistical model, which we know is incorrect).
In s_run_simulations.html, this shows you how to run each of the three models from R.