cutpoints module¶
- itrails.cutpoints.cutpoints_AB(n_int_AB, t_AB, coal_AB)[source]¶
This function returns the cutpoints for the intervals for the two-sequence CTMC. The cutpoints will be defined by the quantiles of a truncated exponential distribution.
- Parameters:
n_int_AB (int) – Number of intervals in the two-sequence CTMC.
t_AB (float) – Total time interval of the two-sequence CTMC
coal_AB (float) – coalescent rate of the two-sequence CTMC.
- Returns:
cut_AB
- Return type:
np.array
- itrails.cutpoints.cutpoints_ABC(n_int_ABC, coal_ABC)[source]¶
This function returns the cutpoints for the intervals for the three-sequence CTMC. The cutpoints will be defined by the quantiles of an exponential distribution.
- Parameters:
n_int_ABC (int) – Number of intervals in the three-sequence CTMC.
coal_ABC (float) – coalescent rate of the three-sequence CTMC.
- Returns:
cut_ABC
- Return type:
np.array
- itrails.cutpoints.get_times(cut, intervals)[source]¶
Returns a list of time differences for each specified interval.
This function computes the duration for each interval defined by the given indices. It does so by subtracting the earlier cutpoint from the subsequent one based on the indices provided in the intervals list.
- Parameters:
cut (list[float]) – List of ordered cutpoints.
intervals (list[int]) – Ordered indices of cutpoints that define the intervals.
- Returns:
List of time differences between consecutive cutpoints as defined by intervals.
- Return type:
list[float]