class_docstr: Class to hold results from fitting an VARMAX model.
  
  Parameters
  ----------
  model : VARMAX instance
      The fitted model instance
  
  Attributes
  ----------
  specification : dictionary
      Dictionary including all attributes from the VARMAX model instance.
  coefficient_matrices_var : ndarray
      Array containing autoregressive lag polynomial coefficient matrices,
      ordered from lowest degree to highest.
  coefficient_matrices_vma : ndarray
      Array containing moving average lag polynomial coefficients,
      ordered from lowest degree to highest.
  
  See Also
  --------
  statsmodels.tsa.statespace.kalman_filter.FilterResults
  statsmodels.tsa.statespace.mlemodel.MLEResults
docstr: Set the final predicted state value using out-of-sample `exog` / trend
  
  Parameters
  ----------
  exog : ndarray
      Out-of-sample `exog` values, usually produced by
      `_validate_out_of_sample_exog` to ensure the correct shape (this
      method does not do any additional validation of its own).
  out_of_sample : int
      Number of out-of-sample periods.
  
  Notes
  -----
  We need special handling for forecasting with `exog`, because
  if we had these then the last predicted_state has been set to NaN since
  we did not have the appropriate `exog` to create it.
code: def _set_final_predicted_state(self, exog, out_of_sample):
      """
      Set the final predicted state value using out-of-sample `exog` / trend
  
      Parameters
      ----------
      exog : ndarray
          Out-of-sample `exog` values, usually produced by
          `_validate_out_of_sample_exog` to ensure the correct shape (this
          method does not do any additional validation of its own).
      out_of_sample : int
          Number of out-of-sample periods.
  
      Notes
      -----
      We need special handling for forecasting with `exog`, because
      if we had these then the last predicted_state has been set to NaN since
      we did not have the appropriate `exog` to create it.
      """
      flag = out_of_sample and self.model.k_exog > 0
  
      if flag:
          tmp_endog = concat(
              [self.model.endog[-1:], np.zeros((1, self.model.k_endog))]
          )
          if self.model.k_exog > 0:
              tmp_exog = concat([self.model.exog[-1:], exog[:1]])
          else:
              tmp_exog = None
  
          tmp_trend_offset = self.model.trend_offset + self.nobs - 1
          tmp_mod = self.model.clone(
              tmp_endog, exog=tmp_exog, trend_offset=tmp_trend_offset
          )
          constant = self.filter_results.predicted_state[:, -2]
          stationary_cov = self.filter_results.predicted_state_cov[
              :, :, -2
          ]
          tmp_mod.ssm.initialize_known(
              constant=constant, stationary_cov=stationary_cov
          )
          tmp_res = tmp_mod.filter(
              self.params,
              transformed=True,
              includes_fixed=True,
              return_ssm=True,
          )
  
          # Patch up `predicted_state`
          self.filter_results.predicted_state[
              :, -1
          ] = tmp_res.predicted_state[:, -2]
      try:
          yield
      finally:
          if flag:
              self.filter_results.predicted_state[:, -1] = np.nan
  
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 VARMAXResults obj's underlying member method code with example usage: obj._set_final_predicted_state(exog, out_of_sample) without return types