docs: def _msge_with_gradient_overdetermined(data, delta, xvschema, skipstep, p):
      """Calculate mean squared generalization error and its gradient for
      overdetermined equation system.
      """
      t, m, l = data.shape
      d = None
      l, k = 0, 0
      nt = np.ceil(t / skipstep)
      for trainset, testset in xvschema(t, skipstep):
  
          a, b = _construct_var_eqns(atleast_3d(data[trainset, :, :]), p)
          c, d = _construct_var_eqns(atleast_3d(data[testset, :, :]), p)
  
          e = sp.linalg.inv(np.eye(a.shape[1]) * delta ** 2 + a.T.dot(a))
  
          ba = b.transpose().dot(a)
          dc = d.transpose().dot(c)
          bae = ba.dot(e)
          baee = bae.dot(e)
          baecc = bae.dot(c.transpose().dot(c))
  
          l += np.sum(baecc * bae - 2 * bae * dc) + np.sum(d ** 2)
          k += np.sum(baee * dc - baecc * baee) * 4 * delta
  
      return l / (nt * d.size), k / (nt * d.size)