def calcChoiceProbs(Vals, sigma):
    '\n    Returns the choice probabilities given the choice specific value functions\n    `Vals`. Probabilities are degenerate if sigma == 0.0.\n    Parameters\n    ----------\n    Vals : [numpy.array]\n        A numpy.array that holds choice specific values at common grid points.\n    sigma : float\n        A number that controls the variance of the taste shocks\n    Returns\n    -------\n    Probs : [numpy.array]\n        A numpy.array that holds the discrete choice probabilities\n    '
    if (sigma == 0.0):
        Pflat = np.argmax(Vals, axis=0)
        Probs = np.zeros(Vals.shape)
        for i in range(Vals.shape[0]):
            Probs[i][(Pflat == i)] = 1
        return Probs
    maxV = np.max(Vals, axis=0)
    Probs = np.divide(np.exp(((Vals - maxV) / sigma)), np.sum(np.exp(((Vals - maxV) / sigma)), axis=0))
    return Probs
Returns the choice probabilities given the choice specific value functions
`Vals`. Probabilities are degenerate if sigma == 0.0.
Parameters
----------
Vals : [numpy.array]
    A numpy.array that holds choice specific values at common grid points.
sigma : float
    A number that controls the variance of the taste shocks
Returns
-------
Probs : [numpy.array]
    A numpy.array that holds the discrete choice probabilities
def calcChoiceProbs(Vals, sigma):
    '\n    Returns the choice probabilities given the choice specific value functions\n    `Vals`. Probabilities are degenerate if sigma == 0.0.\n    Parameters\n    ----------\n    Vals : [numpy.array]\n        A numpy.array that holds choice specific values at common grid points.\n    sigma : float\n        A number that controls the variance of the taste shocks\n    Returns\n    -------\n    Probs : [numpy.array]\n        A numpy.array that holds the discrete choice probabilities\n    '
    if (sigma == 0.0):
        Pflat = np.argmax(Vals, axis=0)
        Probs = np.zeros(Vals.shape)
        for i in range(Vals.shape[0]):
            Probs[i][(Pflat == i)] = 1
        return Probs
    maxV = np.max(Vals, axis=0)
    Probs = np.divide(np.exp(((Vals - maxV) / sigma)), np.sum(np.exp(((Vals - maxV) / sigma)), axis=0))
    return Probs