Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in custom root state with find.mle #14

Open
richfitz opened this issue Nov 16, 2015 · 0 comments
Open

Bug in custom root state with find.mle #14

richfitz opened this issue Nov 16, 2015 · 0 comments
Labels

Comments

@richfitz
Copy link
Owner

Surprised that this is not tested, but it's a bug.

library(diversitree)
pars <- c(.1, .1, .03, .03, .1, .2)
set.seed(3)
phy <- trees(pars, "bisse", max.taxa=25, max.t=Inf, x0=0)[[1]]
#fitting a Mk2 model without and with root constraint
lik <- make.mk2(phy, phy$tip.state)
fit.mk2 <- find.mle(lik, c(.1, .1))
fit.mk2.root <- find.mle(lik,c(.1,.1), root=ROOT.GIVEN, root.p=c(0,1))
#fitting an ER model without and with root constraint
lik2=constrain(lik,q01~q10)
fit.er <- find.mle(lik2, 0.1)
fit.er.root <- find.mle(lik2, 0.1, root=ROOT.GIVEN, root.p=c(0,1), keep.func=TRUE) # error
fit.er.root <- find.mle(lik2, 0.1, root=ROOT.GIVEN, root.p=c(0,1), keep.func=FALSE)

Fix is just a bit off faffing in do.mle.search

Reported by Sébastien Lavergne

@richfitz richfitz added the bug label Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant