egttools.utils.find_saddle_type_and_gradient_direction¶
- find_saddle_type_and_gradient_direction(gradient, saddle_points_idx, offset=0.01)[source]¶
Finds whether a saddle point is stable or not. And defines the direction of the gradient among stable and unstable points.
- Parameters
gradient (Union[List[float], numpy.ndarray[numpy.float64[1,m]]]) – array containing the gradient of selection for all states of the population
saddle_points_idx (Union[List[int], numpy.ndarray[numpy.int64[1,m]]]) – array containing the saddle points indices
offset (float) – offset for the gradient_directions, so that arrows don’t overlap with point
- Returns
Tuple containing an array that indicates the type of saddle points and another array indicating the direction of the gradient between unstable and stable points
- Return type