Hi Rohini! OK, let's see.
> I am trying to model a population of asexually reproducing species in
> a nonWF model.
OK, so using addCrossed(), I suppose? (It's helpful, when asking a
question on the list, to show the code you've got.)
> I want to model the viability based on relative fitness, rather than
> absolute.
OK. That is different from the standard nonWF model, where fitness is
absolute, as you realize I think. Where is "fitness" coming from? Is
it just from density-dependence, as you describe below? Or are there
mutations affecting fitness, and/or other processes?
> Though I have a carrying capacity, I would like one of birth or death
> to be fitness dependant and the other to be random. It doesn't matter
> which one is fitnes based. However, since viability is based on
> fitness values intrinsically, I want to to scale it so as to preserve
> some stochasticity in the system wrt population size around the
> carrying capacity.
I'm not sure what you mean by "scale it" exactly, and why that "scaling"
preserves stochasticity, and so forth; can you clarify this?
> So far, I have implemented a finess influenced birth process with
> number of deaths (x) being dependant on K-p1.individualCount, while
> choosing individuals to die is completely random.
OK. And how have you implemented those two things exactly? Again,
seeing the code you're working on makes things much more concrete.
> I assign fitness values for everyone to be 10,000 and pick x
> individuals and set their fitness to 0.3 (since I still want to
> preserve some stochasticity). This however doesn't result in any
> deaths and my population size keeps growing. I do recalculate fitness
> in an early event since the birth processes are fitness dependant.
It's hard to guess what might be going wrong. You say it "doesn't
result in any deaths". How do you know that, versus that deaths are
perhaps being outbalanced by births? What are you seeing in SLiMgui?
What does the age distribution plot show, for example?
> If anyone has insights on how survival probabilities are calculated
> from fitness values, or how a nonWF model can be implemented with
> relative fitness, I would really appreciate the help.
Chapters 23 and 24 of the SLiM manual spell out the details of exactly
what happens in the WF and nonWF tick cycles (23 and 24 respectively).
Section 24.4 details the viability/survival tick cycle stage in nonWF
models, and says:
For a given individual, a fitness of 0.0 or less results in certain
death; that individual is immediately removed from its subpopulation. A
fitness of 1.0 or greater results in certain survival; that individual
remains in its subpopulation, and will live into the next tick cycle. A
fitness greater than 0.0 and less than 1.0 is interpreted as a survival
probability; SLiM will do a random draw to determine whether the
individual survives or not.
There is a good deal of additional discussion in that section; perhaps
give it a read and come back if you have more questions about that. As
for how a nonWF model can be implemented with relative fitness, see
section 15.13, on implementing a Wright–Fisher model with a nonWF model;
that will probably be helpful.
> In addition, I am having difficulty printing out individual fitness
> values to debug with.
What kind of difficulty? What code did you try, and what happened?
Maybe this is a good time to plug a paper I wrote a little while ago,
Ten Simple Rules of Reporting a Bug:
https://doi.org/10.1371/journal.pcbi.1010540
And I hope you don't mind if I also ask: have you done the SLiM workshop
yet? It seems like maybe you're struggling with some foundational
concepts here, and I always recommend that people start by doing the
workshop, otherwise the learning curve can indeed be rather steep! :->
Cheers,
-B.
Benjamin C. Haller
Messer Lab
Cornell University