tess.analysis.efbd: tess.analysis.efbd

Description Usage Arguments Value Examples

View source: R/tess.analysis.efbd.R

Description

Running an analysis on a given tree and estimating the diversification rates including rate-shifts and mass-extinction events.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
tess.analysis.efbd(
  tree,
  initialSpeciationRate,
  initialExtinctionRate,
  initialFossilizationRate,
  empiricalHyperPriors = TRUE,
  empiricalHyperPriorInflation = 10,
  empiricalHyperPriorForm = c("lognormal", "normal", "gamma"),
  speciationRatePriorMean = 0,
  speciationRatePriorStDev = 1,
  extinctionRatePriorMean = 0,
  extinctionRatePriorStDev = 1,
  fossilizationRatePriorMean = 0,
  fossilizationRatePriorStDev = 1,
  initialSpeciationRateChangeTime = c(),
  initialExtinctionRateChangeTime = c(),
  initialFossilizationRateChangeTime = c(),
  estimateNumberSpeciationRateChanges = TRUE,
  estimateNumberExtinctionRateChanges = TRUE,
  estimateNumberFossilizationRateChanges = TRUE,
  numExpectedRateChanges = 2,
  samplingProbability = 1,
  samplingStrategy = "uniform",
  missingSpecies = c(),
  timesMissingSpecies = c(),
  tInitialMassExtinction = c(),
  pInitialMassExtinction = c(),
  pMassExtinctionPriorShape1 = 5,
  pMassExtinctionPriorShape2 = 95,
  estimateMassExtinctionTimes = TRUE,
  numExpectedMassExtinctions = 2,
  estimateNumberMassExtinctions = TRUE,
  MRCA = TRUE,
  CONDITION = "survival",
  BURNIN = 10000,
  MAX_ITERATIONS = 2e+05,
  THINNING = 100,
  OPTIMIZATION_FREQUENCY = 500,
  CONVERGENCE_FREQUENCY = 1000,
  MAX_TIME = Inf,
  MIN_ESS = 500,
  ADAPTIVE = TRUE,
  dir = "",
  priorOnly = FALSE,
  verbose = TRUE
)

Arguments

tree

the phylogeny

initialSpeciationRate

The initial value of the speciation rate when the MCMC is started.

initialExtinctionRate

The initial value of the extinction rate when the MCMC is started.

initialFossilizationRate

The initial value of the fossilization rate when the MCMC is started.

empiricalHyperPriors

.

empiricalHyperPriorInflation

.

empiricalHyperPriorForm

.

speciationRatePriorMean

mean parameter for the lognormal prior on lambda

speciationRatePriorStDev

standard deviation for the lognormal prior on lambda

extinctionRatePriorMean

mean parameter for the lognormal prior on mu

extinctionRatePriorStDev

standard deviation for the lognormal prior on mu

fossilizationRatePriorMean

mean parameter for the lognormal prior on phi

fossilizationRatePriorStDev

standard deviation for the lognormal prior on phi

initialSpeciationRateChangeTime

The initial value of the time points when speciation rate-shifts occur.

initialExtinctionRateChangeTime

The initial value of the time points when extinction rate-shifts occur.

initialFossilizationRateChangeTime

The initial value of the time points when fossilization rate-shifts occur.

estimateNumberSpeciationRateChanges

Do we estimate the number of rate shifts?

estimateNumberExtinctionRateChanges

Do we estimate the number of rate shifts?

estimateNumberFossilizationRateChanges

Do we estimate the number of rate shifts?

numExpectedRateChanges

Expected number of rate changes which follow a Poisson process.

samplingProbability

probability of uniform sampling at present

samplingStrategy

Which strategy was used to obtain the samples (taxa). Options are: uniform|diversified|age

missingSpecies

The number of species missed which originated in a given time interval (empirical taxon sampling)

timesMissingSpecies

The times intervals of the missing species (empirical taxon sampling)

tInitialMassExtinction

The initial value of the vector of times of the mass-extinction events.

pInitialMassExtinction

The initial value of the vector of survival probabilities of the mass-extinction events.

pMassExtinctionPriorShape1

The alpha (first shape) parameter of the Beta prior distribution for the survival probability of a mass-extinction event.

pMassExtinctionPriorShape2

The beta (second shape) parameter of the Beta prior distribution for the survival probability of a mass-extinction event.

estimateMassExtinctionTimes

Do we estimate the times of mass-extinction events?

numExpectedMassExtinctions

Expected number of mass-extinction events which follow a Poisson process.

estimateNumberMassExtinctions

Do we estimate the number of mass-extinction events?

MRCA

does the tree start at the mrca?

CONDITION

do we condition the process on nothing|survival|taxa?

BURNIN

number of starting iterations to be dropped

MAX_ITERATIONS

The maximum number of iteration of the MCMC.

THINNING

The frequency how often samples are recorded during the MCMC.

OPTIMIZATION_FREQUENCY

The frequency how often the MCMC moves are optimized

CONVERGENCE_FREQUENCY

The frequency how often we check for convergence?

MAX_TIME

The maximum time the MCMC is allowed to run in seconds.

MIN_ESS

The minimum number of effective samples (ESS) to assume convergence.

ADAPTIVE

Do we use auto-tuning of the MCMC moves?

dir

The subdirectory in which the output will be stored.

priorOnly

Do we sample from the prior only?

verbose

Do we want to print the progress of the MCMC?

Value

nothing. outputs are written to the file system

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# we load the conifers as the test data set
data(conifers)

# for the conifers we know what the total number of species is
total <- 630
# thus, we can compute what the sampling fraction is
rho <- (conifers$Nnode+1)/total


# next, we specify the prior mean and standard deviation
# for the speciation and extinction rate
mu_lambda = 0.15
std_lambda = 0.02
mu_mu = 0.09
std_mu = 0.02
mu_phi = 0.10
std_phi = 0.02



# now we can run the entire analysis.
# note that a full analyses should be run much longer
tess.analysis.efbd( tree=conifers,
                    initialSpeciationRate = exp(mu_lambda),
                    initialExtinctionRate = exp(mu_mu),
                    initialFossilizationRate = exp(mu_phi),
                    empiricalHyperPriors = FALSE,
                    speciationRatePriorMean = mu_lambda,
                    speciationRatePriorStDev = std_lambda,
                    extinctionRatePriorMean = mu_mu,
                    extinctionRatePriorStDev = std_mu,
                    fossilizationRatePriorMean = mu_phi,
                    fossilizationRatePriorStDev = std_phi,
                    numExpectedRateChanges = 2,
                    samplingProbability = rho,
                    numExpectedMassExtinctions = 2,
                    BURNIN = 100,
                    MAX_ITERATIONS = 200,
                    THINNING = 10,
                    dir = "analysis_conifer")

hoehna/TESS documentation built on Feb. 3, 2022, 5:59 a.m.