richfitz / diversitree

diversitree: comparative phylogenetic analyses of diversification
http://www.zoology.ubc.ca/prog/diversitree
30 stars 9 forks source link

QuaSSE gives confusing error message when diffusion ommitted #9

Open richfitz opened 10 years ago

richfitz commented 10 years ago

Should just check number of parameters and avoid this error.

    library(diversitree)
    lambda <- function(x) sigmoid.x(x, 0.1, 0.2,  0, 2.5)
    mu <- function(x) constant.x(x, 0.03)
    char <- make.brownian.with.drift(0, 0.025)

    set.seed(1)
    phy <- tree.quasse(c(lambda, mu, char), max.taxa=15, x0=0,
                       single.lineage=FALSE, verbose=TRUE)

    lik <- make.quasse(phy, phy$tip.state, 0.5, constant.x, constant.x)
    p <- starting.point.quasse(phy, phy$tip.state)
    lik(p)