class_docstr: A VECM model, or Vector Error Correction Model, is a restricted.
  
  VAR model used for nonstationary series that are cointegrated.r
  
  Parameters
  ----------
  dates : array_like of datetime, optional
      See :class:`statsmodels.tsa.base.tsa_model.TimeSeriesModel` for more
      information.
  freq : str, optional
      See :class:`statsmodels.tsa.base.tsa_model.TimeSeriesModel` for more
      information.
  missing : str, optional, default="none"
      See :class:`statsmodels.base.model.Model` for more information.
  k_ar_diff : int, optional, default=1
      Number of lagged differences in the model. Equals :math:`k_{ar} - 1` in
      the formula above.
  coint_rank : int, optional, default=1
      Cointegration rank, equals the rank of the matrix :math:`\\Pi` and the
      number of columns of :math:`\\alpha` and :math:`\\beta`.
  deterministic : str, optional, default="n"
      must be one of {``"n"``, ``"co"``, ``"ci"``, ``"lo"``, ``"li"``}
  
      * ``"n"`` - no deterministic terms
      * ``"co"`` - constant outside the cointegration relation
      * ``"ci"`` - constant within the cointegration relation
      * ``"lo"`` - linear trend outside the cointegration relation
      * ``"li"`` - linear trend within the cointegration relation
  
      Combinations of these are possible (e.g. ``"cili"`` or ``"colo"`` for
      linear trend with intercept). When using a constant term you have to
      choose whether you want to restrict it to the cointegration relation
      (i.e. ``"ci"``) or leave it unrestricted (i.e. ``"co"``). Do not use
      both ``"ci"`` and ``"co"``. The same applies for ``"li"`` and ``"lo"``
      when using a linear term. See the Notes-section for more information.
  seasons : int, optional, default: 0
      Number of periods in a seasonal cycle. 0 means no seasons.
  first_season : int, optional, default: 0
      Season of the first observation.
  method : str {"ml"}, default: "ml"
      Estimation method to use. "ml" stands for Maximum Likelihood.
  exog_coint : optional, a scalar (float), 1D ndarray of size nobs,
      2D ndarray/pd.DataFrame of size (any, neqs)
      Deterministic terms inside the cointegration relation.
  exog_coint_fc : optional, a scalar (float), 1D ndarray of size nobs,
      2D ndarray/pd.DataFrame of size (any, neqs)
      Forecasted value of exog_coint
  
  Example
  -------
  >>> from sktime.forecasting.vecm import VECM
  >>> from sktime.split import temporal_train_test_split
  >>> from sktime.forecasting.base import ForecastingHorizon
  >>> index = pd.date_range(start="2005", end="2006-12", freq="M")
  >>> df = pd.DataFrame(np.random.randint(0, 100, size=(23, 2)),
  ... columns=list("AB"),
  ... index=pd.PeriodIndex(index))
  >>> train, test = temporal_train_test_split(df)
  >>> sktime_model = VECM()  # doctest: +SKIP
  >>> fh = ForecastingHorizon([1, 3, 4, 5, 7, 9])
  >>> _ = sktime_model.fit(train, fh=fh)  # doctest: +SKIP
  >>> fc2 = sktime_model.predict(fh=fh)  # doctest: +SKIP
docstr: Fit forecaster to training data.
  
  Wrapper for statsmodel's VECM (_VECM) fit method
  
  Parameters
  ----------
  y : pd.DataFrame, guaranteed to have 2 or more columns
      Time series to which to fit the forecaster.
  fh : guaranteed to be ForecastingHorizon
      The forecasting horizon with the steps ahead to to predict.
      Required (non-optional) here if self.get_tag("requires-fh-in-fit")==True
      Otherwise, if not passed in _fit, guaranteed to be passed in _predict
  X : pd.DataFrame, optional (default=None)
      Exogeneous time series to fit to.
  
  Returns
  -------
  self : reference to self
code: def _fit(self, y, fh=None, X=None):
      """Fit forecaster to training data.
  
      Wrapper for statsmodel's VECM (_VECM) fit method
  
      Parameters
      ----------
      y : pd.DataFrame, guaranteed to have 2 or more columns
          Time series to which to fit the forecaster.
      fh : guaranteed to be ForecastingHorizon
          The forecasting horizon with the steps ahead to to predict.
          Required (non-optional) here if self.get_tag("requires-fh-in-fit")==True
          Otherwise, if not passed in _fit, guaranteed to be passed in _predict
      X : pd.DataFrame, optional (default=None)
          Exogeneous time series to fit to.
  
      Returns
      -------
      self : reference to self
      """
      from statsmodels.tsa.vector_ar.vecm import VECM as _VECM
  
      self._forecaster = _VECM(
          endog=y,
          exog=X,
          exog_coint=self.exog_coint,
          dates=self.dates,
          freq=self.freq,
          missing=self.missing,
          k_ar_diff=self.k_ar_diff,
          coint_rank=self.coint_rank,
          deterministic=self.deterministic,
          seasons=self.seasons,
          first_season=self.first_season,
      )
  
      self._fitted_forecaster = self._forecaster.fit(method=self.method)
      return self
  
file_path: sktime/sktime/forecasting/vecm.py
imports: import numpy
  import pandas
  from sktime.forecasting.base.adapters import _StatsModelsAdapter
label_desc: Use image node_id 2 for calling the VECM obj's underlying member method code with example usage: obj._fit(y, fh, X) and returns: self