Skip to content

voiage.core.utils.get_optimal_strategy_index

get_optimal_strategy_index([positional or keyword] nb_array: np.ndarray | ValueArray = None) -> np.ndarray

Determine the optimal strategy for each PSA sample.

The optimal strategy for a given sample is the one with the maximum net benefit.

Args: nb_array (Union[np.ndarray, NetBenefitArray]): A 2D NumPy array of net benefits (samples x strategies) or a NetBenefitArray instance.

np.ndarray: A 1D array of integers, where each element is the index of the optimal strategy for the corresponding sample.

Parameters:

  • nb_array np.ndarray | ValueArray

Returns: np.ndarray