code: def ARcomponents(rho, n, drho=0.05, cor=False, sigma=1):
      """
      Numerically differentiate covariance matrices
      of AR(p) of length n with respect to AR parameters
      around the value rho.
  
      If drho is a vector, they are treated as steps in the numerical
      differentiation.
      """
  
      rho = np.asarray(rho)
      drho = np.asarray(drho)
  
      p = rho.shape[0]
      value = []
  
      if drho.shape == ():
          drho = np.ones(p, np.float64) * drho
      drho = np.diag(drho)
  
      Q = ARcovariance(rho, n, cor=cor, sigma=sigma)
      value = [Q]
      for i in range(p):
          value.append(
              (ARcovariance(rho + drho[i], n, cor=cor) - Q) / drho[i, i]
          )
      return np.asarray(value)
  
imports: import numpy
  from numpy.linalg import inv
label_desc: Use image node_id 2 for calling a global function with example usage: ARcomponents(rho, n, drho, cor, sigma) and returns: np