# Rev Language Reference

## simBirthDeath

Simulates a tree under a very general birth-death process. Parameters are fed in as a n_cats by n_intervals matrix, such that the ith row is the rate vector for the ith category.

### Usage

simBirthDeath(RealPos[] timeline, RealPos[][] lambda, RealPos[][] mu, RealPos[][] phi, Probability[][] r, Probability[][] Lambda, Probability[][] Mu, Probability[][] Phi, Probability[][] R, Simplex rootCategory, RealPos time)

### Arguments

 timeline : RealPos[] (pass by const reference) The endpoints of the time intervals (episodes). You should include 0 at the end. We use ages before the present. Default : [ 0.000 ] lambda : RealPos[][] (pass by const reference) The speciation rates for each interval. mu : RealPos[][] (pass by const reference) The extinction rates for each interval. Default : 0 phi : RealPos[][] (pass by const reference) The sampling rates for each interval. Default : 0 r : Probability[][] (pass by const reference) The extinction probability when rate-sampling happens for each interval. Default : 0 Lambda : Probability[][] (pass by const reference) The burst probability at the end of each interval. Default : 0 Mu : Probability[][] (pass by const reference) The (mass) extinction probability at the end of each interval. Default : 0 Phi : Probability[][] (pass by const reference) The sampling probability at the end of each interval. Default : 0 R : Probability[][] (pass by const reference) The extinction probability when event-sampling happens for each interval. Default : 0 rootCategory : Simplex (pass by const reference) The probabilities of the categories for the root. Default : [ 1.000 ] time : RealPos (pass by const reference) The time/age before the present.