sim.genespeciestree: sim.genespeciestree: Simulating birth-death species trees...

Description Usage Arguments Value Author(s) References Examples

Description

sim.genespeciestree simulates birth-death species trees (using sim.bd.taxa or sim.bd.taxa.age). Within each species tree, a gene tree is simulated, assuming a coalescent with coalescent rate being 1. The method returns summary statistics for the gene tree.

Usage

1
sim.genespeciestree(n, numbsim, lambda, mu, frac = 1, age=0)

Arguments

n

Number of extant sampled tips.

numbsim

Number of trees to simulate.

lambda

Speciation rate.

mu

Extinction rate.

frac

Each tip is included into the final species tree with probability frac.

age

The time since origin / most recent common ancestor. If age = 0 (default) a uniform prior for the time since origin is assumed.

Value

statistics

For each simulated gene tree the following statistics are returned (with "gammaspecies" being the gamma statistic for the corresponding species tree): "Colless","s","Sackin","cherries","matching of species tree and gene tree","gammaspecies","gamma".

Author(s)

Tanja Stadler

References

T. Stadler, J. Degnan, N. Rosenberg. Manuscript.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Simulate two gene trees within two species trees:
n<-10
lambda <- 2.0
mu <- 0.5
frac <-0.6
numbsim<-2
age<-2

# Simulation is conditioned on 10 final tips
sim.genespeciestree(n, numbsim, lambda, mu, frac, 0)

# Simulation is conditioned on 10 final tips and tree age 2
sim.genespeciestree(n, numbsim, lambda, mu, frac, age)

Example output

Loading required package: ape
Loading required package: geiger
  Colless        s Sackin cherries matching gammastruc      gamma
1       8 7.454720     36        3        0 -1.2746623 0.08168716
2      12 7.390181     38        4        0 -0.8793313 0.52578141
  Colless        s Sackin cherries matching gammastruc      gamma
1      15 7.544332     39        4        0 -0.1061794 -0.1086585
2      12 8.083329     38        3        0 -2.4683434 -0.6592069

TreeSim documentation built on May 2, 2019, 3:23 a.m.