ben18785 / Selection_simulations

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

functional groups #11

Open Armand1 opened 5 years ago

Armand1 commented 5 years ago

With the new life-history data that I estimated for generation time (time-to-repro and reproductive longevity) I have 2 more variables that I could use for clustering into functional groups. I found that I still had good data on 133 species. Re-running the clustering (gaussian models in McClust) I found that the best clustering solution was 10 and the second best was 3. Using the earlier functional data I found only 2 clusters.

I believe that the way to think about the potential effects of functional groups is as follows. Suppose that the clusters have some ecological, functional, reality: they pick out groups of species that live in more or less the same habitat and are competing with each other. In that case, if a species within a given cluster increases in frequency, then other species in the same cluster will be directly hit and decrease --- more so than species in other clusters. So the effects of frequency independent selection will be felt most strongly within clusters.

However, if we total up the number of individuals in each cluster --- think of them as functional species then they should tend to be mean reverting relative to each other. Consider: if, for some reason, there is a spike in the number of sunshine-loving trees in one generation, and sunshine is limiting, then they should collectively suffer --- die more or reproduce less --- and, in subsequent generations, return to the level allowed by the equilibrium amount of sunshine. That is, we should see negative frequency dependent selection among clusters.

This should be evident from just eyeballing the frequencies. When we look at individual species, we find that many of them show directional trends. That's consistent with our general finding of frequency independent selection. The plot below shows the frequencies of the 3 functional groups discovered by my gaussian clustering. I think that it may show a mean frequency-reverting pattern. At least they're not strongly directional. Of course I can't say that they're not a random walk in frequency space, but, a priori, it seems reasonable to test the idea that they're not. (Clusters composed of random collections of species should, of course, show random walks.)

3 clusters.pdf

Notice, however, that 95% of species are in one cluster. If I made a stack plot the fluctuations would hardly register.

Here are the reproductive-only data with clustering solutions. Note that now there are only 133 spp. BCI_data_forben_reproductives_withclusters.csv.zip

Armand1 commented 5 years ago

This is just a note to help me keep straight what you've done.

On 11 June you wrote: The results are in... From the first clustering (with 10 clusters) the results are that the independent selection model wins, followed by frequency dependent then neutral. From the second clustering, the neutral model wins followed by independent then frequency dependent. So the frequency dependent model isn't looking too great... The selection coefficients were calculated and normalised by the maximum selection coefficient estimate and I attach quantiles of these for the frequency dependent ('freq') and independent ('inde') cases for each of the two clusterings (metaspecies1 and metaspecies2). The rows follow the numeric clustering designations you followed (so that row 1 corresponds to cluster 1, and so on). If you want to replicate the analysis, have a look at the "src/s_reproductives_metaspecies.Rmd" folder in the BCI repo. All that is needed to be done is to change the "mod1_clusters" column to a new clustering and the code chunks below it should hopefully just work. The proof is in the pudding however...

These results (bci_metaspecies1_freq_selection and 3 similarly named files test selection among the clusters. That's is what we are interested in.

Armand1 commented 5 years ago

This is just a note to help me keep straight what you've done.

On 23 May you wrote:

*I've finally got round to running the model fitting on the BCI reproductives. For the dataset "BCI_data_forben_reproductivesonly_with_gt.csv", the frequency independent model is still by far the best fit to the data.

For the clusters, the fits are more interesting. Find them attached. I've only fit clusters where there were more than 5 different species in each, meaning there are 6 clusters under your first clustering scheme ('mod1_clusters') and 3 for your second ('mod2_clusters'). In some cases, the frequency dependent model is a better fit than the independent model (although the differences in fit are slight).*

These results (bci_clusters1_results.rds and bci_clusters2_results.rds test selection within the clusters. That's not what we are interested in.

Armand1 commented 5 years ago

I have the selection coefficients from 11 June -- the among cluster fits -- but not the fits themselves expressed in terms of elpd_loo. I need those too.