tess.plot.multichain.diagnostics: tess.plot.multichain.diagnostics: Plotting the mcmc...

Description Usage Arguments Details Author(s) Examples

View source: R/tess.plot.multichain.diagnostics.R

Description

tess.plot.multichain.diagnostics plots MCMC diagnostics for the output generated by a tess.process.output(...) command. Fore more examples see the vignette.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
tess.plot.multichain.diagnostics(outputs,
                                      parameters=c("speciation rates",
                                                   "speciation shift times",
                                                   "extinction rates",
                                                   "extinction shift times",
                                                   "net-diversification rates",
                                                   "relative-extinction rates",
                                                   "mass extinction times"),
                                      diagnostics="Gelman-Rubin",
                                      gelman.crit=1.05,
                                      xlab="million years ago",
                                      col=NULL,
                                      xaxt="n",
                                      yaxt="s",
                                      pch=19,
                                      ...)

Arguments

outputs

The processed output for plotting.

parameters

Which parameters to diagnose. See details for a complete description.

diagnostics

Which diagnostics to use. Currently the only option is "Rubin-Gelman".

gelman.crit

The critical value above which a Rubin-Gelman statistic is considered a failure.

xlab

The label of the x-axis. By default, millions of years.

col

Colors used for printing. Must be of same length as fig.types.

xaxt

The type of x-axis to plot. By default, no x-axis is plotted (recommended).

yaxt

The type of y-axis to plot.

pch

The type of points to draw (if points are drawn).

...

Arguments delegated to plot()

Details

This function generates visual summaries of multi-chain MCMC diagnostics for the CoMET analysis in the output object. The argument parameters specifies the aspects of the model to summarize. Valid options are:

Author(s)

Michael R. May

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
41
# Load the data, compute the sampling fraction rho
data(conifers)
totalConiferSpecies <- 630
sampledConiferSpecies <- conifers$Nnode+1
rho <- sampledConiferSpecies / totalConiferSpecies

# Run a tess analysis
tess.analysis(tree = conifers,
              initialSpeciationRate=c(1.0),
              initialExtinctionRate=c(0.5),
              empiricalHyperPriors = FALSE,
              numExpectedRateChanges = 2,
              numExpectedMassExtinctions = 2,
              samplingProbability = rho,
              MAX_ITERATIONS = 200,
              BURNIN = 100,
              dir = "./run_1")

tess.analysis(tree = conifers,
              initialSpeciationRate=c(1.0),
              initialExtinctionRate=c(0.5),
              empiricalHyperPriors = FALSE,
              numExpectedRateChanges = 2,
              numExpectedMassExtinctions = 2,
              samplingProbability = rho,
              MAX_ITERATIONS = 200,
              BURNIN = 100,
              dir = "./run_2")

# Process the output
coniferOutput_1 <- tess.process.output(dir="./run_1",
                                     numExpectedRateChanges=2,
                                     numExpectedMassExtinctions=2)

coniferOutput_2 <- tess.process.output(dir="./run_2",
                                     numExpectedRateChanges=2,
                                     numExpectedMassExtinctions=2)

# Plot the output
outputs <- list(coniferOutput_1,coniferOutput_2)
tess.plot.multichain.diagnostics(outputs)

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