class_docstr: Fit VAR and then estimate structural components of A and B, defined:
  
  .. math:: Ay_t = A_1 y_{t-1} + \ldots + A_p y_{t-p} + B\var(\epsilon_t)
  
  Parameters
  ----------
  endog : array_like
      1-d endogenous response variable. The independent variable.
  dates : array_like
      must match number of rows of endog
  svar_type : str
      "A" - estimate structural parameters of A matrix, B assumed = I
      "B" - estimate structural parameters of B matrix, A assumed = I
      "AB" - estimate structural parameters indicated in both A and B matrix
  A : array_like
      neqs x neqs with unknown parameters marked with 'E' for estimate
  B : array_like
      neqs x neqs with unknown parameters marked with 'E' for estimate
  
  References
  ----------
  Hamilton (1994) Time Series Analysis
class_docstr_tok: ["Fit","VAR","and","then","estimate","structural","components","of","A","and","B",",","defined",":","..","math",":",":","Ay_t","=","A_1","y_","{","t-1","}","+","\\ldots","+","A_p","y_","{","t-p","}","+","B\\var","(","\\epsilon_t",")","Parameters","--","--","--","--","--","endog",":","array_like","1-d","endogenous","response","variable",".","The","independent","variable",".","dates",":","array_like","must","match","number","of","rows","of","endog","svar_type",":","str","``","A","''","-","estimate","structural","parameters","of","A","matrix",",","B","assumed","=","I","``","B","''","-","estimate","structural","parameters","of","B","matrix",",","A","assumed","=","I","``","AB","''","-","estimate","structural","parameters","indicated","in","both","A","and","B","matrix","A",":","array_like","neqs","x","neqs","with","unknown","parameters","marked","with","'","E","'","for","estimate","B",":","array_like","neqs","x","neqs","with","unknown","parameters","marked","with","'","E","'","for","estimate","References","--","--","--","--","--","Hamilton","(","1994",")","Time","Series","Analysis"]
code: def _compute_J(self, A_solve, B_solve):
      # first compute appropriate duplication matrix
      # taken from Magnus and Neudecker (1980),
      # "The Elimination Matrix: Some Lemmas and Applications
      # the creation of the D_n matrix follows MN (1980) directly,
      # while the rest follows Hamilton (1994)
  
      neqs = self.neqs
      sigma_u = self.sigma_u
      A_mask = self.A_mask
      B_mask = self.B_mask
  
      # first generate duplication matrix, see MN (1980) for notation
  
      D_nT = np.zeros([int((1.0 / 2) * (neqs) * (neqs + 1)), neqs**2])
  
      for j in range(neqs):
          i = j
          while j <= i < neqs:
              u = np.zeros([int((1.0 / 2) * neqs * (neqs + 1)), 1])
              u[
                  int(j * neqs + (i + 1) - (1.0 / 2) * (j + 1) * j - 1)
              ] = 1
              Tij = np.zeros([neqs, neqs])
              Tij[i, j] = 1
              Tij[j, i] = 1
              D_nT = D_nT + np.dot(u, (Tij.ravel("F")[:, None]).T)
              i = i + 1
  
      D_n = D_nT.T
      D_pl = npl.pinv(D_n)
  
      # generate S_B
      S_B = np.zeros((neqs**2, len(A_solve[A_mask])))
      S_D = np.zeros((neqs**2, len(B_solve[B_mask])))
  
      j = 0
      j_d = 0
      if len(A_solve[A_mask]) != 0:
          A_vec = np.ravel(A_mask, order="F")
          for k in range(neqs**2):
              if A_vec[k]:
                  S_B[k, j] = -1
                  j += 1
      if len(B_solve[B_mask]) != 0:
          B_vec = np.ravel(B_mask, order="F")
          for k in range(neqs**2):
              if B_vec[k]:
                  S_D[k, j_d] = 1
                  j_d += 1
  
      # now compute J
      invA = npl.inv(A_solve)
      J_p1i = np.dot(np.dot(D_pl, np.kron(sigma_u, invA)), S_B)
      J_p1 = -2.0 * J_p1i
      J_p2 = np.dot(np.dot(D_pl, np.kron(invA, invA)), S_D)
  
      J = np.append(J_p1, J_p2, axis=1)
  
      return J
  
imports: import numpy
  import numpy.linalg
  from numpy.linalg import slogdet
  from statsmodels.tools.decorators import deprecated_alias
  from statsmodels.tools.numdiff import approx_fprime, approx_hess
  import statsmodels.tsa.base.tsa_model
  from statsmodels.tsa.vector_ar.irf import IRAnalysis
  import statsmodels.tsa.vector_ar.util
  from statsmodels.tsa.vector_ar.var_model import VARProcess, VARResults
label_desc: Use image node_id 9 for calling the SVAR obj's underlying member method code with example usage: obj._compute_J(A_solve, B_solve) and returns: J