PPSDiscrete: Create Simulated Datasets via PPS

Description Usage Arguments Value Author(s) References Examples

View source: R/PPSDiscrete.R

Description

This function performs posterior predictive simulations of discrete traits. The function is written to work with the output of bayesian programs that produce a collection of rate matrix parameter estimates based on either one or a collection of trees.

Usage

1
PPSDiscrete(trees, MCMC, states, N = 2)

Arguments

trees

an object of class "multiPhylo" or "phylo" containing the trees used in generting the rate estimates

MCMC

this will normally be a log file that is brought into R with read.csv the columns for a three state character should be: tree, qAA, qBA, qCA, qAB, qBB, qCB, qAC, qBC, qCC. If your analysis involves only a single tree then the tree column should be excluded.

states

a vector of root probabilities

N

the number of PPS datasets desired

Value

A matrix is returned with the rownames being the species names from the tree and each column containing a result of a single PPS.

Author(s)

Heath Blackmon

References

http://coleoguy.github.io/

Examples

1
2
3
4
5
6
7
8
9
data(trees)
data(mcmc2)
data(mcmc3)
# 1 tree 100 q-mats 3 states
PPSDiscrete(trees[[1]], MCMC=mcmc3[,2:10], states=c(.5,.2,.3), N=2)
# 10 trees 100 q-mats 3 states
PPSDiscrete(trees, MCMC=mcmc3, states=c(.5,.2,.3), N=10)
# 10 trees 100 q-mats 2 states
PPSDiscrete(trees, MCMC=mcmc2, states=c(.5,.5), N=10)

evobiR documentation built on May 2, 2019, 5:40 a.m.