code: def whiten_individuals_loop(x, transform, group_iter):
      """apply linear transform for each individual
  
      loop version
      """
  
      # Note: figure out dimension of transformed variable
      # so we can pre-allocate
      x_new = []
      for g in group_iter():
          x_g = x[g]
          x_new.append(np.dot(transform, x_g))
  
      return np.concatenate(x_new)
  
imports: import numpy
  from statsmodels.regression.linear_model import OLS, GLS
  from statsmodels.tools.grouputils import GroupSorted
label_desc: Use image node_id 3 for calling a global function with example usage: whiten_individuals_loop(x, transform, group_iter) and returns: np