

def _arma_predict_in_sample(start, end, endog, resid, k_ar, method):
    '\n    Pre- and in-sample fitting for ARMA.\n    '
    if ('mle' in method):
        fittedvalues = (endog - resid)
    else:
        fittedvalues = (endog[k_ar:] - resid)
    fv_start = start
    if ('mle' not in method):
        fv_start -= k_ar
    fv_end = min(len(fittedvalues), (end + 1))
    return fittedvalues[fv_start:fv_end]

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/arima_model.py _arma_predict_in_sample/original