def ma(error, params, offset):
    """ Calculate the moving average part.

    :param error: list of error terms
    :param params: list of coefficients
    :param offset: index of last predicted value
    :return: float
    """
    return sum([params[i] * error[offset - i] for i in range(len(params))])