get_trans_emiss module

itrails.get_trans_emiss.trans_emiss_calc(t_A, t_B, t_C, t_2, t_upper, t_out, N_AB, N_ABC, r, n_int_AB, n_int_ABC, cut_AB, cut_ABC)[source]

Calculate the emission and transition probabilities given a set of parameters.

Parameters:
  • t_A (numeric) – Time in generations from the present to the first speciation event for species A (times mutation rate)

  • t_B (numeric) – Time in generations from the present to the first speciation event for species B (times mutation rate)

  • t_C (numeric) – Time in generations from the present to the second speciation event for species C (times mutation rate)

  • t_2 (numeric) – Time in generations from the first speciation event to the second speciation event (times mutation rate)

  • t_upper (numeric) – Time in generations between the end of the second-to-last interval and the third speciation event (times mutation rate)

  • t_out (numeric) – Time in generations from the present to the third speciation event for species D, plus the divergence between the ancestor of D and the ancestor of A, B, and C at the time of the third speciation event (times mutation rate)

  • N_AB (numeric) – Effective population size between speciation events (times mutation rate)

  • N_ABC (numeric) – Effective population size in deep coalescence, before the second speciation event (times mutation rate)

  • r (numeric) – Recombination rate per site per generation (divided by mutation rate)

  • n_int_AB (int) – Number of discretized time intervals between speciation events

  • n_int_ABC (int) – Number of discretized time intervals in deep coalescent

  • cut_AB (Array-like) – Cutpoints in the A-B process.

  • cut_ABC (Array-like) – Cutpoints in the A-B-C process.

Returns:

A tuple containing: - a: Transition probability matrix. - b: Emission probability matrix. - pi: Vector of starting probabilities of the hidden states. - hidden_names: Mapping from indices to hidden state names. - observed_names: Mapping from indices to observed names.

Return type:

tuple(numpy.ndarray, numpy.ndarray, numpy.ndarray, dict, dict)