'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 ARMAX, 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'

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

    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((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)
    fcasterr = self._forecast_error(steps)
    conf_int = self._forecast_conf_int(forecast, fcasterr, alpha)
    return (forecast, fcasterr, conf_int)
