def METHOD_NAME(signal):
    """Cost function for a normally distributed signal with a changing variance."""
    cumm = [0.0]
    cumm.extend(np.cumsum(np.power(np.abs(signal - np.mean(signal)), 2)))
    def cost(s, t):
        dist = float(t - s)
        diff = cumm[t] - cumm[s]
        return dist * np.log(diff / dist)
    return cost