class_docstr: Base class for plotting and computing IRF-related statistics, want to be
  able to handle known and estimated processes
class_docstr_tok: ["Base","class","for","plotting","and","computing","IRF-related","statistics",",","want","to","be","able","to","handle","known","and","estimated","processes"]
code: def __init__(
      self,
      model,
      P=None,
      periods=10,
      order=None,
      svar=False,
      vecm=False,
  ):
      self.model = model
      self.periods = periods
      self.neqs, self.lags, self.T = model.neqs, model.k_ar, model.nobs
  
      self.order = order
  
      if P is None:
          sigma = model.sigma_u
  
          # TODO, may be difficult at the moment
          # if order is not None:
          #     indexer = [model.get_eq_index(name) for name in order]
          #     sigma = sigma[:, indexer][indexer, :]
  
          #     if sigma.shape != model.sigma_u.shape:
          #         raise ValueError('variable order is wrong length')
  
          P = la.cholesky(sigma)
  
      self.P = P
  
      self.svar = svar
  
      self.irfs = model.ma_rep(periods)
      if svar:
          self.svar_irfs = model.svar_ma_rep(periods, P=P)
      else:
          self.orth_irfs = model.orth_ma_rep(periods, P=P)
  
      self.cum_effects = self.irfs.cumsum(axis=0)
      if svar:
          self.svar_cum_effects = self.svar_irfs.cumsum(axis=0)
      else:
          self.orth_cum_effects = self.orth_irfs.cumsum(axis=0)
  
      # long-run effects may be infinite for VECMs.
      if not vecm:
          self.lr_effects = model.long_run_effects()
          if svar:
              self.svar_lr_effects = np.dot(model.long_run_effects(), P)
          else:
              self.orth_lr_effects = np.dot(model.long_run_effects(), P)
  
      # auxiliary stuff
      if vecm:
          self._A = util.comp_matrix(model.var_rep)
      else:
          self._A = util.comp_matrix(model.coefs)
  
imports: import numpy
  import numpy.linalg
  import scipy.linalg
  from statsmodels.tools.decorators import cache_readonly
  import statsmodels.tsa.tsatools
  import statsmodels.tsa.vector_ar.plotting
  import statsmodels.tsa.vector_ar.util
label_desc: Use image node_id 1 to create a new BaseIRAnalysis object  with example: obj = BaseIRAnalysis(model, P, periods, order, svar, vecm)