'Out-of-sample forecasts
Parameters
steps : int
The number of out of sample forecasts from the end of the
sample.
exog : array
If the model is an ARIMAX, you must provide out of sample
values for the exogenous variables. This should not include
the constant.
alpha : float
The confidence intervals for the forecasts are (1 - alpha) %
Returns
forecast : array
Array of out of sample forecasts
stderr : array
Array of the standard error of the forecasts.
conf_int : array
2d array of the confidence interval for the forecast
Notes
Prediction is done in the levels of the original endogenous variable.
If you would like prediction of differences in levels use `predict`.'

def forecast(self, steps=1, exog=None, alpha=0.05):

    if (exog is not None):
        if ((self.k_exog == 1) and (exog.ndim == 1)):
            exog = exog[:, None]
        if (exog.shape[0] != steps):
            raise ValueError('new    exog    needed    for    each    step')
        if (self.k_ar > 0):
            exog = np.vstack((self.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)
    d = self.k_diff
    endog = self.model.data.endog[(- d):]
    forecast = unintegrate(forecast, unintegrate_levels(endog, d))[d:]
    fcerr = self._forecast_error(steps)
    conf_int = self._forecast_conf_int(forecast, fcerr, alpha)
    return (forecast, fcerr, conf_int)
