X-Git-Url: https://git.donarmstrong.com/?p=ape.git;a=blobdiff_plain;f=R%2Face.R;h=b67549f9dccf4cd55b3d68b0fe5bd7ffb3f9ef8b;hp=33c72de5d72c60039bcdf7e4ac1ec2a7e055cae2;hb=57c9d4fd10a4449c27c65873eaf9315b5b7ed874;hpb=081bbd65bc9bbf19658c1dfc0724d17bf925626e 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))