code: def _update_shared_response(X, S, W, features):
          
          subjs = len(X)
          TRs = X[0].shape[1]
          R = np.zeros((features, TRs))
          # Project the subject data with the individual component removed into
          # the shared subspace and average over all subjects.
          for i in range(subjs):
              R += W[i].T.dot(X[i]-S[i])
          R /= subjs
          return R
docs: Update the shared response `R`.
  
          Parameters
          ----------
  
          X : list of 2D arrays, element i has shape=[voxels_i, timepoints]
              Each element in the list contains the fMRI data for alignment of
              one subject.
  
          S : list of array, element i has shape=[voxels_i, timepoints]
              The individual component :math:`S_i` for each subject.
  
          W : list of array, element i has shape=[voxels_i, features]
              The orthogonal transforms (mappings) :math:`W_i` for each subject.
  
          features : int
              The number of features in the model.
  
          Returns
          -------
  
          R : array, shape=[features, timepoints]
              The updated shared response.