int_combine_states module

itrails.int_combine_states.combine_states(iter_lst_a, iter_lst_b, probs_a, probs_b)[source]

Given two lists of states and their probabilities, this function returns a list of combined states and their probabilities.

Each state is represented by a list of tuples. Each tuple of size 2 corresponds to two consecutive sites, so left and right respectively. 0 corresponds to no site, 1 to an uncoalesced site, 2 to a site with one coalescent from 2 sites, 3 to 2 coalescents from 3 sites, and so on. For example, (0, 1) corresponds to ( -o), while (1, 2) represents (o–x). A list of tuples, thus, represents a state of a CTMC.

Parameters:
  • iter_lst_a (list of lists of tuples) – Each nested list represents the CTMC states

  • iter_lst_b (list of lists of tuples) – Each nested list represents the CTMC states

  • probs_a (list) – Probabilities corresponding to iter_lst_a

  • probs_a – Probabilities corresponding to iter_lst_b