Hi Michael,

When I run your code I get states for the nodes, so I'm not sure what the 
problem is. However, I notice in your message you tried to get the node states 
from $States, so I wonder if this is a typo or if this is the problem: the node 
reconstructions are in $states (note the lower case 's')?

Cheers,

Kev


----------------------------------------------------------------------

Message: 1
Date: Fri, 26 Feb 2016 12:34:16 -0500
From: Michael Foisy <mrfo...@ualberta.ca>
To: r-sig-phylo@r-project.org
Subject: [R-sig-phylo] [corHMM reconstruction not estimating internal
        node    states]
Message-ID:
        <CAKHDkwpShJb9Cq4w=tTtx8sQMhEVrbGwpHwriU=ow0z+w1s...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hello,



I'm running some precursor models in corHMM to understand the evolution of
a discrete binary character.  Some example code using data(primates) below,
but what happens is the internal nodes are not being estimated ($States =
NaN).  Also, when I unclass(precursor2.primates), the internal Node labels
are all "NA".  Still solves the optimization, but I can't plot the
reconstruction!





library(corHMM)

data(primates)



#write precursor matrix (Marazzi et al., 2012):

precursor2.matrix <- matrix(data = c(NA, NA, 2, NA,

                                     NA, NA, NA, NA,

                                     1, NA, NA, 4,

                                     NA, NA, 3, NA ),

                            nrow = 4, ncol = 4,

                            byrow = TRUE

)

rownames(precursor2.matrix) <- c("(0,R1)", "(1,R1)", "(0,R2)", "(1,R2)")

rownames(precursor2.matrix)

colnames(precursor2.matrix) <- c("(0,R1)", "(1,R1)", "(0,R2)", "(1,R2)")

colnames(precursor2.matrix)



#running the precursor-2 model:

precursor2.primates <- corHMM(primates$tree,primates$trait,rate.cat
=2,rate.mat=precursor2.matrix,node.states="marginal",diagn=FALSE)



unclass(precursor2.primates)



Am I neglecting something in the corHMM() function, or is there something
else going on?  I run into the same NaN when running the precursor matrices
Beaulieu wrote into the corHMM notes.







Any help is appreciated!  Thank you!

,  Michael Foisy



MSc. Student

University of Toronto

michael.fo...@mail.utoronto.ca

        [[alternative HTML version deleted]]



------------------------------

Subject: Digest Footer

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

------------------------------

End of R-sig-phylo Digest, Vol 97, Issue 12

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to