pull.pars: Utility function for retrieving parameters from an MCMC chain

Description Usage Arguments Value Examples

View source: R/bayou-mcmc-utilities.R

Description

Utility function for retrieving parameters from an MCMC chain

Usage

1
pull.pars(i, chain, model = "OU")

Arguments

i

An integer giving the sample to retrieve

chain

A bayouMCMC chain

model

The parameterization used, either "OU", "QG" or "OUrepar"

Value

A bayou formatted parameter list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
tree <- sim.bdtree(n=30)
tree$edge.length <- tree$edge.length/max(branching.times(tree))
prior <- make.prior(tree, dists=list(dk="cdpois", dsig2="dnorm", dtheta="dnorm"), 
             param=list(dk=list(lambda=15, kmax=32), dsig2=list(mean=1, sd=0.01), 
                 dtheta=list(mean=0, sd=3)), plot.prior=FALSE)

pars <- priorSim(prior, tree, plot=FALSE, nsim=1)$pars[[1]]
dat <- dataSim(pars, model="OU", phenogram=FALSE, tree)$dat
fit <- bayou.mcmc(tree, dat, model="OU", prior=prior,
             new.dir=TRUE, ngen=5000, plot.freq=NULL)
chain <- load.bayou(fit, save.Rdata=TRUE, cleanup=TRUE)
plotBayoupars(pull.pars(300, chain), tree)

## End(Not run)

bayou documentation built on June 7, 2018, 5:05 p.m.