Currently, the package allows users to include trees that have no branch lengths. The model fails to fit in this case.
library(ape)
library(coevolve)
set.seed(1)
n <- 10
tree <- rtree(n, br = NULL) # no branch lengths
d <- data.frame(
id = tree$tip.label,
x = rnorm(n),
y = rnorm(n)
)
m <- coev_fit(
data = d,
variables = list(
x = "normal",
y = "normal"
),
id = "id",
tree = tree
)
# Chain 4 Rejecting initial value:
#Chain 4 Error evaluating the log probability at the initial value.
#Chain 4 Exception: cholesky_decompose: Matrix m is not positive definite
# Warning messages:
#1: All chains finished unexpectedly! Use the $output(chain_id) method for more information.
Since the model fundamentally depends on branch lengths, we should preclude users from entering trees like this. I will add an error message.
Currently, the package allows users to include trees that have no branch lengths. The model fails to fit in this case.
Since the model fundamentally depends on branch lengths, we should preclude users from entering trees like this. I will add an error message.