

def forecast(self, steps=1, exog=None, alpha=0.05):
    '\n        Out-of-sample forecasts\n\n        Parameters\n        ----------\n        steps : int\n            The number of out of sample forecasts from the end of the\n            sample.\n        exog : array\n            If the model is an ARMAX, you must provide out of sample\n            values for the exogenous variables. This should not include\n            the constant.\n        alpha : float\n            The confidence intervals for the forecasts are (1 - alpha) %\n\n        Returns\n        -------\n        forecast : array\n            Array of out of sample forecasts\n        stderr : array\n            Array of the standard error of the forecasts.\n        conf_int : array\n            2d array of the confidence interval for the forecast\n        '
    if (exog is not None):
        exog = np.asarray(exog)
        if ((self.k_exog == 1) and (exog.ndim == 1)):
            exog = exog[:, None]
        elif (exog.ndim == 1):
            if (len(exog) != self.k_exog):
                raise ValueError('1d exog given and len(exog) != k_exog')
            exog = exog[None, :]
        if (exog.shape[0] != steps):
            raise ValueError('new exog needed for each step')
        if (self.k_ar > 0):
            exog = np.vstack((steps.model.exog[(- self.k_ar):, self.k_trend:], exog))
    forecast = _arma_predict_out_of_sample(self.params, steps, self.resid, self.k_ar, self.k_ma, self.k_trend, self.k_exog, self.model.endog, exog, method=self.model.method)
    fcasterr = self._forecast_error(steps)
    conf_int = self._forecast_conf_int(forecast, fcasterr, alpha)
    return (forecast, fcasterr, conf_int)

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/arima_model.py ARMAResults.forecast/VarMisuse@155/473 `self`->`steps`