mwpennell / arbutus

Assessing the adequacy of phylogenetic models of quantitative trait evolution
7 stars 2 forks source link

diversitree unit tree tests fail #14

Closed mwpennell closed 10 years ago

mwpennell commented 10 years ago

I can't quite figure out what is going on here

If I fit a model with diversitree's MCMC function

library(diversitree)
library(arbutus)
data(finch)
phy <- finch$phy
states <- finch$data[,"wingL"]
lik <- make.bm(phy, states)
samples.bm <- mcmc(lik, x.init=1, w=1, nsteps=1000, print.every=0)
m <- make_unit_tree(samples.bm, sample=10)

this seems to work fine. however in the file /tests/test-unit-tree.R under the heading "Unit tree construction from BM/diversitree/MCMC with SE works", there is something like this

  fit.bm <- find.mle(lik.bm, .1)
  set.seed(1)
  samples.bm <- mcmc(lik.bm, coef(fit.bm), 100, w=0.1, print.every=0)

  ## Quick check:
  idx <- 5
  fit.bm$par <- coef(samples.bm)[idx,]
  fit.bm$lnLik <- samples.bm$p[idx]
  cmp <- make_unit_tree(fit.bm)
  expect_that(phy.unit[[idx]], is_identical_to(cmp))

which fails because the parameter names are not being returned correctly and make_unit_tree(fit.bm) cannot parse the fit.bm object. did you change how diversitree returned parameters since you wrote the test. i don't think this is anything I did when I changed the function names.

any ideas. m

richfitz commented 10 years ago

This is working on travis, so it must be a change since the last CRAN diversitree release.