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 __init__(
      self,
      endog,
      svar_type,
      dates=None,
      freq=None,
      A=None,
      B=None,
      missing="none",
  ):
      super().__init__(endog, None, dates, freq, missing=missing)
      # (self.endog, self.names,
      # self.dates) = data_util.interpret_data(endog, names, dates)
  
      self.neqs = self.endog.shape[1]
  
      types = ["A", "B", "AB"]
      if svar_type not in types:
          raise ValueError(
              "SVAR type not recognized, must be in " + str(types)
          )
      self.svar_type = svar_type
  
      svar_ckerr(svar_type, A, B)
  
      self.A_original = A
      self.B_original = B
  
      # initialize A, B as I if not given
      # Initialize SVAR masks
      if A is None:
          A = np.identity(self.neqs)
          self.A_mask = A_mask = np.zeros(A.shape, dtype=bool)
      else:
          A_mask = np.logical_or(A == "E", A == "e")
          self.A_mask = A_mask
      if B is None:
          B = np.identity(self.neqs)
          self.B_mask = B_mask = np.zeros(B.shape, dtype=bool)
      else:
          B_mask = np.logical_or(B == "E", B == "e")
          self.B_mask = B_mask
  
      # convert A and B to numeric
      # TODO: change this when masked support is better or with formula
      # integration
      Anum = np.zeros(A.shape, dtype=float)
      Anum[~A_mask] = A[~A_mask]
      Anum[A_mask] = np.nan
      self.A = Anum
  
      Bnum = np.zeros(B.shape, dtype=float)
      Bnum[~B_mask] = B[~B_mask]
      Bnum[B_mask] = np.nan
      self.B = Bnum
  
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 1 to create a new SVAR object from inherited base classes: tsbase with example: obj = SVAR(endog, svar_type, dates, freq, A, B, missing)