Calculates the mean and variance from vals and pmf

    Parameters
    ----------
    vals : ndarray
        Value range for a distribution
    pmf : ndarray
        pmf values corresponding with vals

    Returns
    -------
    : tuple
        (mean, variance)

def _mean_var(vals, pmf):
    """
    Calculates the mean and variance from vals and pmf

    Parameters
    ----------
    vals : ndarray
        Value range for a distribution
    pmf : ndarray
        pmf values corresponding with vals

    Returns
    -------
    : tuple
        (mean, variance)

    """

    mean = np.sum(vals * pmf)
    var = np.sum(vals ** 2 * pmf) - mean ** 2
    return mean, var