code: def ancova(Y, Y_em, V_Y, R, n):
      """Analysis of Covariance."""
      # Compute the sum of all Y_em terms
      Y0 = np.sum(Y_em, axis=1)
  
      # Initialize each variable
      S, S_a, S_b = np.zeros((3, n))
  
      # Analysis of covariance
      for j in range(n):
          # Covariance matrix of jth term of Y_em and actual Y
          C = np.cov(np.stack((Y_em[:, j], Y), axis=0))
  
          # Total sensitivity of jth term         ( = Eq. 19 of Li et al )
          S[j] = C[0, 1] / V_Y
  
          # Covariance matrix of jth term with emulator Y without jth term
          C = np.cov(np.stack((Y_em[:, j], Y0 - Y_em[:, j]), axis=0))
  
          # Structural contribution of jth term   ( = Eq. 20 of Li et al )
          S_a[j] = C[0, 0] / V_Y
  
          # Correlative contribution of jth term  ( = Eq. 21 of Li et al )
          S_b[j] = C[0, 1] / V_Y
  
      return (S, S_a, S_b)
  
imports: from typing import Dict
  from types import MethodType
  import itertools
  import time
  import warnings
  import numpy
  from numpy.linalg import solve
  from numpy.linalg import svd
  from numpy import identity
  import pandas
  from scipy import stats, special, interpolate
  from .None import common_args
  from ..util import read_param_file, ResultDict
  from SALib.plotting.hdmr import plot
  from SALib.util.problem import ProblemSpec
label_desc: Use image node_id 10 for calling a global function with example usage: ancova(Y, Y_em, V_Y, R, n) and returns: S,  S_a,  S_b