ben18785 / Selection_simulations

Simulating Wright-Fisher, Moran and Yule processes.
1 stars 1 forks source link

BCI things to implement #10

Open Armand1 opened 5 years ago

Armand1 commented 5 years ago

This is a list, in one place, of things that we might want to implement in our next BCI model

(1) species names when reshaping the data for the model, keep the name codes so that they can be associated with species names and hence biology

(2) years/generation times currently we estimate beta in terms of intervals. But the intervals themselves are uneven, varying between 5 and 10 years. And ultimately we want to couch beta in terms of selection coefficients. Since selection coefficients are calibrated in terms of generations, we need some conversion such as

beta_generations = (mean years between intervals) / (generation time trees)* beta_intervals.

In fact, generation time of trees is probably more like 60 years, but we need an expert to tell us what a plausible number might be. This correction might be incorporated directly in the inference model and /or forward simulations.

(3) selection coefficients in fact, it might be better to actually have selection coefficients as the output of the model rather than beta. This is so that we deal with the uncertainty of the estimates properly when calculating s. Under the selection coefficients issue, I review the equations that I am using and their rationale. https://github.com/ben18785/Selection_simulations/issues/3#issuecomment-478253208

(4) renaming beta At a trivial level, we should rename the parameter we output as beta rather than s, since its current name is continuing source of confusion (to me).

(5) reproductives currently we assume all trees are reproductive. This is certainly not true, and I think we need to use only trees of a certain size (say bhd > 10 cm). Again, we need an expert to tell us that. I have asked Chisholm.

(6) subgroups once we have this going, considering subdividing the data based on 2 functional clusters and re-running the analysis on each.

Armand1 commented 5 years ago

generation time. This is how I estimated generation time. Chisholm gave me the following equation:

generation time = x + y + z/2 where x is years from germination to 10mm bhd. We don't have species-specific data on this since BCI only counts trees > 10mm bhd. But Hubbell has estimated it for tropical trees as 16.6 years.

y is time from 10mm to size at reproduction, robin. To get this, I estimated, for each species, the average size-specific growth rate from the BCI data, assumed exponential growth, and then calculated the years till robin

z is mean reproductive lifespan. To get this I considered only trees that were >= robin. I then estimated their average annual survival rate from the BCI data; mean reproductive lifespan is, then, 1/annual survival rate.

Put these altogether and you get a median generation time, across species, of 110 years. For individual species, the generation times range from 19 to 627 years --- though the last is a bit of an outlier, the next longest is some 300 years. Chisholm thinks that these estimates make sense.

I was not able to obtain estimates of y or z for all species for which I had robin. That is because some species had no individuals that died (so could not estimate z) and some had no pre-reproductive individuals (so could not estimate y). But z and y are positively, albeit, weakly correlated and so I imputed one from the other for the missing values. Hence the name of the generation time file (imputed).

Armand1 commented 5 years ago

reshaping data. You told me that it takes some effort to reshape the data into a form usable for the STAN model. Is it possible to give me the code that does so? That means that I could reshape and rerun without hassling you.

Armand1 commented 5 years ago

The new results look super.

Can you send me the reshaped data that you used in the models (where you have coded the "extra" species in?

Also, did you estimate mutation (immigration) rate in these models? We need that as an output too. I imagine, however, that it will be the same as previous.