

def predict(self, params, start=None, end=None, exog=None, dynamic=False):
    method = getattr(self, 'method', 'mle')
    start = self._get_predict_start(start, dynamic)
    (end, out_of_sample) = self._get_predict_end(end, dynamic)
    if (out_of_sample and ((exog is None) and (self.k_exog > 0))):
        raise ValueError('You must provide exog for ARMAX')
    endog = self.endog
    resid = self.geterrors(params)
    k_ar = self.k_ar
    if (exog is not None):
        exog = np.asarray(exog)
        if ((self.k_exog == 1) and (exog.ndim == 1)):
            exog = exog[:, None]
    if ((out_of_sample != 0) and (self.k_exog > 0)):
        if ((self.k_exog > 0) and (k_ar > 0) and (not dynamic)):
            exog = np.vstack((self.exog[(- k_ar):, self.k_trend:], exog))
    if dynamic:
        if (self.k_exog > 0):
            exog = np.vstack((self.exog[(start - k_ar):, self.k_trend:], exog))
        out_of_sample += ((end - start) + 1)
        return _arma_predict_out_of_sample(params, out_of_sample, resid, k_ar, self.k_ma, self.k_trend, self.k_exog, endog, exog, start, method)
    predictedvalues = _arma_predict_in_sample(start, end, endog, params, k_ar, method)
    if out_of_sample:
        forecastvalues = _arma_predict_out_of_sample(params, out_of_sample, resid, k_ar, self.k_ma, self.k_trend, self.k_exog, endog, exog, method=method)
        predictedvalues = np.r_[(predictedvalues, forecastvalues)]
    return predictedvalues

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/arima_model.py ARMA.predict/VarMisuse@339/460 `resid`->`params`