hisse(phy, data, f=c(1,1), hidden.states=TRUE, turnover.anc=c(1,1,0,0),
eps.anc=c(1,1,0,0), trans.rate=NULL, turnover.beta=c(0,0,0,0),
eps.beta=c(0,0,0,0), timeslice=NULL, condition.on.survival=TRUE,
root.type="madfitz", root.p=NULL, output.type="turnover", sann=FALSE,
sann.its=10000, max.tol=.Machine$double.eps^.25)
ape
FALSE
.TRUE
.NULL
.subplex
. The default is FALSE
.subplex
.hisse
returns an object of class hisse.fit
. This is a list with elements:diversitree
, although here we employ modified optimization procedures. For example, rather than optimizing birth and death separately, hisse optimizes orthogonal transformations of these variables: we let tau = birth+death define "net turnover", and we let eps = death/birth define the hisse
expects a two column matrix or data frame, with the first column containing the species names and the second containing the binary character information. Note that the order of the data file and the names in the hisse
deals with this internally. Also, the character information MUST be binary (i.e., states are codes as 0 and 1), otherwise, the function will misbehave.To setup a model, users input vectors containing values to indicate how many free parameters are to be estimated for each of the variables in the model. For example, the
The TransMatMaker
function for more details.
Finally, the options
FitzJohn R.G., Maddison W.P., and Otto S.P. 2009. Estimating trait-dependent speciation and extinction rates from incompletely resolved phylogenies. Syst. Biol. 58:595-611.
Maddison W.P., Midford P.E., and Otto S.P. 2007. Estimating a binary characters effect on speciation and extinction. Syst. Biol. 56:701-710.
Nee S., May R.M., and Harvey P.H. 1994. The reconstructed evolutionary process. Philos. Trans. R. Soc. Lond. B Biol. Sci. 344:305-311.
## Not run
# library(diversitree)
# pars <- c(0.1, 0.2, 0.03, 0.03, 0.01, 0.01)
# set.seed(4)
# phy <- tree.bisse(pars, max.t=30, x0=0)
# sim.dat <- data.frame(names(phy$tip.state), phy$tip.state)
## Fit BiSSE equivalent:
# trans.rates.bisse <- TransMatMaker(hidden.states=FALSE)
# pp.bisse <- hisse(phy, sim.dat, hidden.states=FALSE, turnover.anc=c(1,2,0,0),
# eps.anc=c(1,2,0,0), trans.rate=trans.rates.bisse)
## Now fit HiSSE equivalent with a hidden state for state 1:
# trans.rates.hisse <- TransMatMaker(hidden.states=TRUE)
# trans.rates.hisse <- ParDrop(trans.rates.hisse, c(2,3,5,7,8,9,10,12))
# pp.hisse <- hisse(phy, sim.dat, hidden.states=TRUE, turnover.anc=c(1,2,0,3),
# eps.anc=c(1,2,0,3), trans.rate=trans.rates.hisse)
Run the code above in your browser using DataLab