revbayes / revbayes.archive

GNU General Public License v3.0
68 stars 37 forks source link

Asymmetrical transitions in fnHiddenStateRateMatrix #147

Open roszenil opened 5 years ago

roszenil commented 5 years ago

Hello RevBayes team! The function fnHiddenStateRateMatrix that receives the Q and R matrices for transitions within and between hidden state does not account for possible asymmetrical transitions in the within each hidden state. For example

Q [ 0.000, 0.729, 0.000, 0.715 ] R [ 1.064, 0.559] Then rate_matrix := fnHiddenStateRateMatrix(Q, R, rescaled=false) [ [ -1.0641, 0.0000, 1.0641, 0.0000 ] , 0.7287, -1.7928, 0.0000, 1.0641 ] , 0.5589, 0.0000, -0.5589, 0.0000 ] , 0.0000, 0.5589, 0.7287, -1.2876 ] ]

but instead, entry [4,3] should be 0.715 instead it is 0.7287 and of course the negative sum at [4,4] should change as well. This is because the function only propagates vectors of dimension 2 and not four.