NBISweden / MrBayes

MrBayes is a program for Bayesian inference and model choice across a wide range of phylogenetic and evolutionary models. For documentation and downloading the program, please see the home page:
http://NBISweden.github.io/MrBayes/
GNU General Public License v3.0
232 stars 79 forks source link

stratified total evidence tip dating analysis #255

Open evolucionario opened 2 years ago

evolucionario commented 2 years ago

I'm setting up a stratified total evidence tip dating analysis using the FBD prior following Zhang et al. 2016:

prset samplestrat = diversity 2: 66 0, 23 0;

But MrBayes produces an error:

Setting 1 fossil sampling rate shift time to 66 for partition 1 Time of fossil sampling rate shift must be > 0. Error when setting parameter "Samplestrat" (2) There was an error on at least one processor The error occurred when reading char. 37-37 on line 106 in the file 'stratified.nex'

This alternative code seems to work: prset samplestrat = diversity 2: 66 23;

(so, not specifying rho_i = 0 as the manual indicates) Is this correct?

Thanks!

zhangchicool commented 2 years ago

The code has been changed since the paper was published. The new implementation allows d, r, s to shift at different times, and the order is s, d, r in the command. If you use prset samplestrat = diversity 2: 66 23; it means extant sampling is diversified, fossil sampling proportion s changes at 66 and 33 Ma, net diversification d and turnover s are constant. If you want d, r, s all shift at 66 and 33 Ma, use prset samplestrat = diversity 2: 66 23, 2: 66 23, 2: 66 23; You can also use, for example, prset samplestrat = diversity 3: 66 50 23, 2: 66 23, 1: 55; so that s changes 3 times, d changes 2 times, and r changes 1 time. The new implementation only sets up rho for extant taxa (prset sampleprob = ...), past rho_i's are all 0. I will try to remember to update the manual.

evolucionario commented 2 years ago

Thanks for the clarification. It seems that I am specifying the stratification I wanted.

However the posterior looks a bit strange. Not only for s but also for d and r I'm getting a nearly binary posterior where two values are repeatedly revisited. See screenshots. And the values don't make much sense: fossilization in periods 1 and 3 should be near 0 as we don't have fossils there.

Screen Shot 2021-11-18 at 7 04 08 PM Screen Shot 2021-11-18 at 7 03 34 PM Screen Shot 2021-11-18 at 7 04 17 PM