Open nick-youngblut opened 3 years ago
Also, why hard-code Nleaves instead of getting it from the tree object via length(tree$tip.label)
?
I think hydraPlus is not working well. The hydraPlus embedd the distance matrix into M dimensional space (now M=10), but M=10 is too large compared to the number of leaves in the tree you are giving, rtree(10). I think this may be the cause of error, so could you please check with M=3 to try?
I investigated trees with outgroup in some situations, and Nleaves is length(tree$tip.label)-1 in this situation. The reason of hard-code Nleaves is a remnant of that. So, as pointed out, it would have been better to use length(tree$tip.label) in this case.
Yeah, the number of dimensions was too high, but the same error was generated with less dimensions. Passing Z1
, Nleaves
, and n
to the intended function through optim()
fixed the issue
Sorry, I misread the situation. In the original script, those values are treated as global variables. It's not a complimentary implementation, but it's in the process of being improved through trial and error. I'm glad you were able to fix the error.
It appears that certain objects R not passed to functions in the example scripts, resulting in errors. For example:
produces the output:
Z1
isn't actually passed toobjfn_H1()
inoptim(rep(0,M),objfn_MDS,gr=NULL,method="BFGS")