def ar(series, params, offset):
    """ Calculate the auto regression part.

    :param series: list with transactions
    :param params: list of coefficients, last value is the constant
    :param offset: index of last predicted value
    :return: float
    """
    return params[-1] + sum([params[i] * series[offset-i] for i in range(len(params) - 1)])