1. Take a look at your log file in tracer. What are the estimates for speciation rate and extinction rate? Send a screenshot of the Marginal Probability distributions for both parameters (you can select multiple statistics at once in Tracer).
Alt

Alt

The birth_rate (speciation) parameter = 0.296. The death_rate (extinction) parameter = 0.214

  1. In this exercise we modeled one constant speciation rate and one constant extinction rate. Do you think this a valid model for diversification? How would you like to alter this model to make it more biologically reasonable? Check out tutorials available for RevBayes under the Diversification Rate Estimation subheading: http://revbayes.github.io/tutorials.html Is your altered model described in one of these tutorials?

This model is a useful initial screening for the historical diversification of a group but does not account for many factors.This model does not take into account critical factors for speciation and extinction including parameters shifting with time. This is covered by the Diversification Rate Estimation model.

  1. What is the estimated ancestral state for all primates? Send me the ancestral state:reconstruction figure you made in R.

I made my tree in FigTree Alt

The estimated ancestral state is Type/Character/Trait 1 with a posterior probability of 0.9878

library(coda)
## Warning: package 'coda' was built under R version 3.4.3
library(ggplot2)
source("C:/Users/perez/Desktop/lab_files/scripts/multiplot.R")
name <- "activity_period" 

data <- read.table(paste0("C:/Users/perez/Desktop/lab_files/output/primates_BiSSE_",name,".log"),header=TRUE)
dat_ext  <- data.frame(dens = c(data$extinction.1, data$extinction.2), 
            Type = rep(c("1", "2"), each = length(data$extinction.1)))
            
dat_spec <- data.frame(dens = c(data$speciation.1, data$speciation.2), 
            Type = rep(c("1", "2"), each = length(data$extinction.1)))
            
dat_div  <- data.frame(dens = c(data$speciation.1-data$extinction.1, data$speciation.2-data$extinction.2), 
            Type = rep(c("1", "2"), each = length(data$extinction.1)))
            
dat_rel  <- data.frame(dens = c(data$extinction.1/data$speciation.1, data$extinction.2/data$speciation.2), 
            Type = rep(c("1", "2"), each = length(data$extinction.1)))
pdf(paste0("RevBayes_BiSSE_Results_",name,".pdf"))

p1 <- ggplot(dat_spec, aes(x = dens, fill = Type)) + 
        labs(title = "Speciation", x="Rate", y="Posterior Density") + 
        geom_density(alpha = 0.5)
        
p2 <- ggplot(dat_ext, aes(x = dens, fill = Type)) + 
        labs(title = "Extinction", x="Rate", y="Posterior Density") + 
        geom_density(alpha = 0.5)
        
p3 <- ggplot(dat_div, aes(x = dens, fill = Type)) + 
        labs(title = "Net-Diversification", x="Rate", y="Posterior Density") + 
        geom_density(alpha = 0.5)
p4 <- ggplot(dat_rel, aes(x = dens, fill = Type)) + 
        labs(title = "Relative Extinction", x="Rate", y="Posterior Density") + 
        geom_density(alpha = 0.5)
multiplot(p1, p2, p3, p4)

  1. Look at the PDF of diversification rates. Are the rates state-dependent? What does this tell us about the trait we used in our analysis? Send me the figure of these plots.

The rate states are dependent since the rates differ significantly between type 1 and type 2 as seen in the net-diversification analysis. The differential rate means the trait has some selective significance in evolutionary history for speciation for type 1 species. Extinction rates are somewhat similar, so speciation plays a larger role in this shift.