docs: def running_variance(x):
      '''Given a vector x, compute the variance for x[0:i]
      
      Thank you http://www.johndcook.com/standard_deviation.html
      S[i] = S[i-1]+(x[i]-mean[i-1])*(x[i]-mean[i])
      var(i) = S[i] / (i-1)
      '''
      n = len(x)
      # The mean of x[0:i]
      m = x.cumsum() / np.arange(1,n+1)
      # x[i]-mean[i-1] for i=1...
      x_minus_mprev = x[1:]-m[:-1]
      # x[i]-mean[i] for i=1...
      x_minus_m = x[1:]-m[1:]
      # s for i=1...
      s = (x_minus_mprev*x_minus_m).cumsum()
      var = s / np.arange(1,n)
      # Prepend Inf so we have a variance for x[0]
      return np.hstack(([0],var))