Hi Graeme.
What Matt says is correct, of course, but it is also true that you can
do this with ace or make.simmap.
That would look like:
model<-matrix(c(0,0,1,0),2,2)
rownames(model)<-colnames(model)<-0:1
## ace
fit<-ace(x,tree,type="discrete",model=model)
## make.simmap
trees<-make.simmap(tree,x,model=model,nsim=100)
You (should) get the exact same parameter estimates for the rate 1->0
for all three methods, so it depends what you want to do: stochastic
mapping, marginal ASR, joint ASR, or simply estimate the parameters of
the Mk model.
BUT (and I see that Brian just responded with something along the same
lines) a Dollo character does not imply that 0->1 does not occur, but
that it occurs only once. If the root state is 0, not 1, then this could
make things a little more complicated; however one possibility (and, to
be fair, I haven't given this too much thought), would be to put a
strong prior on the root to be 0 and the transition 0->1 to be low (but
non-zero) using stochastic mapping.
All the best, Liam
Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: [email protected]
blog: http://blog.phytools.org
On 9/14/2015 8:15 PM, Matt Pennell wrote:
## make a likelihood function
lik <- make.mk2(t, d)
## constrain the likelihood so that it only allows forward transitions
lik_con <- constrain(lik, q10~0)
## estimate the MLE
fit <- find.mle(lik_con, 0.1)
## use parameters to do ASR using ML parameters. Other operations also
possible.
asr <- asr.joint(lik_con, fit$par)
_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/