markov jumps and rewards

447 views
Skip to first unread message

Ehud Elnekave

unread,
Oct 16, 2017, 4:22:17 PM10/16/17
to beast-users

Hi all,


I want to calculate the Markov jumps and rewards for a discrete trait analysis

For the jumps – I was able to that following this thread https://groups.google.com/forum/#!topic/beast-users/120iM7sQJ5Y. I summed the number of jumps between traits (e.g. location A to B) in the analysis using the ‘jumpHistory’ log file.

However, I am not sure if (and how) can I use the same output (jumpHistory log file) for calculating the rewards. 


I will appreciate your advice

Thanks,

Udi 

Philippe Lemey

unread,
Oct 17, 2017, 5:39:25 AM10/17/17
to beast...@googlegroups.com
Dear Udi,
The rewards cannot be obtained from the complete jump history. You can potentially get this info if you annotate the trees with the complete jump history, because each time there is a jump on a branch, you know to which state you transition and you can get the time you stay in that state before transitioning to another state on the same branch or a descendent branch. But as you can imagine, it would require a custom script to summarise these quantities from the posterior trees with annotated jump histories.
The easiest would be to add reward parameters to your markovJumpsTreeLikelihood. Referring to the reply to the first question in that thread, you can also add something this (for this 5-state case)
 <rewards>
   <parameter value="1 0 0 0 0" id="reward_A"/>
    <parameter value=“0 1 0 0 0" id="reward_B"/>
    <parameter value=“0 0 1 0 0" id="reward_C"/>
    <parameter value=“0 0 0 1 0" id="reward_D"/>
    <parameter value=“0 0 0 0 1" id="reward_E"/>
 </rewards>
Than also these reward times (for states A to E) will be logged in the standard log file.
Best,
P

--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Ehud Elnekave

unread,
Oct 17, 2017, 11:56:54 AM10/17/17
to beast-users
Dear Philippe,
Thank you! this is very helpful,
Cheers,
Udi

Brandon Stark

unread,
May 11, 2021, 10:04:56 PM5/11/21
to beast-users
Dear Philippe,
i get the reward times, and what how to show by reward trunk?
Reply all
Reply to author
Forward
0 new messages