deepest_ti module¶
- itrails.deepest_ti.deep_identify(current, absorbing_state, omega_nonrev_counts, inverted_omega_nonrev_counts, path, all_paths_dict, by_l=-1, by_r=-1)[source]¶
Recursive function that identifies, in each iteration, the possible paths that can be taken from the current state to the final state. The function is called recursively until the final state is reached. The function stores the paths in the paths_array and all_paths_array arrays.
- Parameters:
current (Tuple of int) – Current omega state in the recursion
absorbing_state (Tuple of int) – Absorbing state
omega_nonrev_counts (Numba typed Dict) – Dictionary containing the number of non-reversible coalescents (value) for each omega state (key)
inverted_omega_nonrev_counts (Numba typed Dict) – Dictionary containing the omega states (value) for each number of non-reversible coalescents (key)
path (Numpy array) – Current path in the recursion
all_paths_dict (Numpy array) – Dictionary that recursively gets filled up with all the paths
by_l (int, optional) – Current omega left subpath, defaults to -1 (initial placeholder value)
by_r (int, optional) – Current omega right subpath, defaults to -1 (initial placeholder value)
- itrails.deepest_ti.deep_identify_wrapper(omega_init, absorbing_state, omega_nonrev_counts, inverted_omega_nonrev_counts, path_to_convert)[source]¶
Wrapper function for the deep_identify function. This function initializes the arrays and dictionaries needed for the recursion and calls the deep_identify function. In the end it returns the transformed keys and the paths.
- Parameters:
omega_init (Tuple of int) – Initial omega state
absorbing_state (Tuple of int) – Absorbing state
omega_nonrev_counts (Numba typed Dict) – Dictionary containing the number of non-reversible coalescents (value) for each omega state (key)
inverted_omega_nonrev_counts (Numba typed Dict) – Dictionary containing the omega states (value) for each number of non-reversible coalescents (key)
- Returns:
Resulting keys and paths
- Return type:
Tuple(Array, Array, Array, int)
- itrails.deepest_ti.deepest_ti(trans_mat_noabs, omega_dict_noabs, path)[source]¶
This function calculated the integral of matrix exponentials with an infinite time limit.
- Parameters:
trans_mat_noabs (Numpy array) – Transition matrix without absorbing states
omega_dict_noabs (Numpy array) – Omega dictionary without absorbing states
path (Numpy array) – Path of omega states
- Returns:
Result of the integral of the series of multiplying matrix exponentials.
- Return type:
Numpy array