X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Face.R;h=b67549f9dccf4cd55b3d68b0fe5bd7ffb3f9ef8b;hb=1f8c4f7bf4f7100178bd11f274247ae9fac1b876;hp=33c72de5d72c60039bcdf7e4ac1ec2a7e055cae2;hpb=50912ceb91f34227ae89432b6e6a8969a3a3f5f7;p=ape.git diff --git a/R/ace.R b/R/ace.R index 33c72de..b67549f 100644 --- a/R/ace.R +++ b/R/ace.R @@ -1,4 +1,4 @@ -## ace.R (2010-05-12) +## ace.R (2010-12-08) ## Ancestral Character Estimation @@ -174,7 +174,8 @@ as the number of categories in `x'") liks[anc, ] <- v/comp[anc] } if (output.liks) return(liks[-TIPS, ]) - -2 * sum(log(comp[-TIPS])) + dev <- -2 * sum(log(comp[-TIPS])) + if (is.na(dev)) Inf else dev } out <- nlminb(rep(ip, length.out = np), function(p) dev(p), lower = rep(0, np), upper = rep(1e50, np))