class_docstr: Vector Autoregressive Moving Average with eXogenous regressors model
  
  Parameters
  ----------
  endog : array_like
      The observed time-series process :math:`y`, , shaped nobs x k_endog.
  exog : array_like, optional
      Array of exogenous regressors, shaped nobs x k.
  order : iterable
      The (p,q) order of the model for the number of AR and MA parameters to
      use.
  trend : str{'n','c','t','ct'} or iterable, optional
      Parameter controlling the deterministic trend polynomial :math:`A(t)`.
      Can be specified as a string where 'c' indicates a constant (i.e. a
      degree zero component of the trend polynomial), 't' indicates a
      linear trend with time, and 'ct' is both. Can also be specified as an
      iterable defining the non-zero polynomial exponents to include, in
      increasing order. For example, `[1,1,0,1]` denotes
      :math:`a + bt + ct^3`. Default is a constant trend component.
  error_cov_type : {'diagonal', 'unstructured'}, optional
      The structure of the covariance matrix of the error term, where
      "unstructured" puts no restrictions on the matrix and "diagonal"
      requires it to be a diagonal matrix (uncorrelated errors). Default is
      "unstructured".
  measurement_error : bool, optional
      Whether or not to assume the endogenous observations `endog` were
      measured with error. Default is False.
  enforce_stationarity : bool, optional
      Whether or not to transform the AR parameters to enforce stationarity
      in the autoregressive component of the model. Default is True.
  enforce_invertibility : bool, optional
      Whether or not to transform the MA parameters to enforce invertibility
      in the moving average component of the model. Default is True.
  trend_offset : int, optional
      The offset at which to start time trend values. Default is 1, so that
      if `trend='t'` the trend is equal to 1, 2, ..., nobs. Typically is only
      set when the model created by extending a previous dataset.
  **kwargs
      Keyword arguments may be used to provide default values for state space
      matrices or for Kalman filtering options. See `Representation`, and
      `KalmanFilter` for more details.
  
  Attributes
  ----------
  order : iterable
      The (p,q) order of the model for the number of AR and MA parameters to
      use.
  trend : str{'n','c','t','ct'} or iterable
      Parameter controlling the deterministic trend polynomial :math:`A(t)`.
      Can be specified as a string where 'c' indicates a constant (i.e. a
      degree zero component of the trend polynomial), 't' indicates a
      linear trend with time, and 'ct' is both. Can also be specified as an
      iterable defining the non-zero polynomial exponents to include, in
      increasing order. For example, `[1,1,0,1]` denotes
      :math:`a + bt + ct^3`.
  error_cov_type : {'diagonal', 'unstructured'}, optional
      The structure of the covariance matrix of the error term, where
      "unstructured" puts no restrictions on the matrix and "diagonal"
      requires it to be a diagonal matrix (uncorrelated errors). Default is
      "unstructured".
  measurement_error : bool, optional
      Whether or not to assume the endogenous observations `endog` were
      measured with error. Default is False.
  enforce_stationarity : bool, optional
      Whether or not to transform the AR parameters to enforce stationarity
      in the autoregressive component of the model. Default is True.
  enforce_invertibility : bool, optional
      Whether or not to transform the MA parameters to enforce invertibility
      in the moving average component of the model. Default is True.
  
  Notes
  -----
  Generically, the VARMAX model is specified (see for example chapter 18 of
  [1]_):
  
  .. math::
  
      y_t = A(t) + A_1 y_{t-1} + \dots + A_p y_{t-p} + B x_t + \epsilon_t +
      M_1 \epsilon_{t-1} + \dots M_q \epsilon_{t-q}
  
  where :math:`\epsilon_t \sim N(0, \Omega)`, and where :math:`y_t` is a
  `k_endog x 1` vector. Additionally, this model allows considering the case
  where the variables are measured with error.
  
  Note that in the full VARMA(p,q) case there is a fundamental identification
  problem in that the coefficient matrices :math:`\{A_i, M_j\}` are not
  generally unique, meaning that for a given time series process there may
  be multiple sets of matrices that equivalently represent it. See Chapter 12
  of [1]_ for more information. Although this class can be used to estimate
  VARMA(p,q) models, a warning is issued to remind users that no steps have
  been taken to ensure identification in this case.
  
  References
  ----------
  .. [1] Lütkepohl, Helmut. 2007.
     New Introduction to Multiple Time Series Analysis.
     Berlin: Springer.
code: def start_params(self):
      params = np.zeros(self.k_params, dtype=np.float64)
  
      # A. Run a multivariate regression to get beta estimates
      endog = pd.DataFrame(self.endog.copy())
      endog = endog.interpolate()
      endog = np.require(endog.bfill(), requirements="W")
      exog = None
      if self.k_trend > 0 and self.k_exog > 0:
          exog = np.c_[self._trend_data, self.exog]
      elif self.k_trend > 0:
          exog = self._trend_data
      elif self.k_exog > 0:
          exog = self.exog
  
      # Although the Kalman filter can deal with missing values in endog,
      # conditional sum of squares cannot
      if np.any(np.isnan(endog)):
          mask = ~np.any(np.isnan(endog), axis=1)
          endog = endog[mask]
          if exog is not None:
              exog = exog[mask]
  
      # Regression and trend effects via OLS
      trend_params = np.zeros(0)
      exog_params = np.zeros(0)
      if self.k_trend > 0 or self.k_exog > 0:
          trendexog_params = np.linalg.pinv(exog).dot(endog)
          endog -= np.dot(exog, trendexog_params)
          if self.k_trend > 0:
              trend_params = trendexog_params[: self.k_trend].T
          if self.k_endog > 0:
              exog_params = trendexog_params[self.k_trend :].T
  
      # B. Run a VAR model on endog to get trend, AR parameters
      ar_params = []
      k_ar = self.k_ar if self.k_ar > 0 else 1
      mod_ar = var_model.VAR(endog)
      res_ar = mod_ar.fit(maxlags=k_ar, ic=None, trend="n")
      if self.k_ar > 0:
          ar_params = np.array(res_ar.params).T.ravel()
      endog = res_ar.resid
  
      # Test for stationarity
      if self.k_ar > 0 and self.enforce_stationarity:
          coefficient_matrices = (
              (
                  ar_params.reshape(
                      self.k_endog * self.k_ar, self.k_endog
                  ).T
              )
              .reshape(self.k_endog, self.k_endog, self.k_ar)
              .T
          )
  
          stationary = is_invertible([1] + list(-coefficient_matrices))
  
          if not stationary:
              warn(
                  "Non-stationary starting autoregressive parameters"
                  " found. Using zeros as starting parameters."
              )
              ar_params *= 0
  
      # C. Run a VAR model on the residuals to get MA parameters
      ma_params = []
      if self.k_ma > 0:
          mod_ma = var_model.VAR(endog)
          res_ma = mod_ma.fit(maxlags=self.k_ma, ic=None, trend="n")
          ma_params = np.array(res_ma.params.T).ravel()
  
          # Test for invertibility
          if self.enforce_invertibility:
              coefficient_matrices = (
                  (
                      ma_params.reshape(
                          self.k_endog * self.k_ma, self.k_endog
                      ).T
                  )
                  .reshape(self.k_endog, self.k_endog, self.k_ma)
                  .T
              )
  
              invertible = is_invertible(
                  [1] + list(-coefficient_matrices)
              )
  
              if not invertible:
                  warn(
                      "Non-stationary starting moving-average parameters"
                      " found. Using zeros as starting parameters."
                  )
                  ma_params *= 0
  
      # Transform trend / exog params from mean form to intercept form
      if self.k_ar > 0 and (self.k_trend > 0 or self.mle_regression):
          coefficient_matrices = (
              (
                  ar_params.reshape(
                      self.k_endog * self.k_ar, self.k_endog
                  ).T
              )
              .reshape(self.k_endog, self.k_endog, self.k_ar)
              .T
          )
  
          tmp = np.eye(self.k_endog) - np.sum(
              coefficient_matrices, axis=0
          )
  
          if self.k_trend > 0:
              trend_params = np.dot(tmp, trend_params)
          if self.mle_regression > 0:
              exog_params = np.dot(tmp, exog_params)
  
      # 1. Intercept terms
      if self.k_trend > 0:
          params[self._params_trend] = trend_params.ravel()
  
      # 2. AR terms
      if self.k_ar > 0:
          params[self._params_ar] = ar_params
  
      # 3. MA terms
      if self.k_ma > 0:
          params[self._params_ma] = ma_params
  
      # 4. Regression terms
      if self.mle_regression:
          params[self._params_regression] = exog_params.ravel()
  
      # 5. State covariance terms
      if self.error_cov_type == "diagonal":
          params[self._params_state_cov] = res_ar.sigma_u.diagonal()
      elif self.error_cov_type == "unstructured":
          cov_factor = np.linalg.cholesky(res_ar.sigma_u)
          params[self._params_state_cov] = cov_factor[
              self._idx_lower_state_cov
          ].ravel()
  
      # 5. Measurement error variance terms
      if self.measurement_error:
          if self.k_ma > 0:
              params[self._params_obs_cov] = res_ma.sigma_u.diagonal()
          else:
              params[self._params_obs_cov] = res_ar.sigma_u.diagonal()
  
      return params
  
imports: import contextlib
  from warnings import warn
  import pandas
  import numpy
  from statsmodels.compat.pandas import Appender
  from statsmodels.tools.tools import Bunch
  from statsmodels.tools.data import _is_using_pandas
  from statsmodels.tsa.vector_ar import var_model
  import statsmodels.base.wrapper
  from statsmodels.tools.sm_exceptions import EstimationWarning
  from .kalman_filter import INVERT_UNIVARIATE, SOLVE_LU
  from .mlemodel import MLEModel, MLEResults, MLEResultsWrapper
  from .initialization import Initialization
  from .tools import is_invertible, concat, prepare_exog, constrain_stationary_multivariate, unconstrain_stationary_multivariate, prepare_trend_spec, prepare_trend_data
label_desc: Use image node_id 4 for calling the VARMAX obj's underlying member method code with example usage: obj.start_params() and returns: params