def calc_empirical_influence_abc(term_plus,
                                 term_minus,
                                 epsilon):
    """
    Calculates the finite difference, midpoint / slope approximation to the
    empirical influence array needed to compute the approximate boostrap
    confidence (ABC) intervals.

    Parameters
    ----------
    term_plus : 2D ndarray.
        Should have one row for each observation. Should have one column for
        each parameter in the parameter vector being estimated. Elements should
        denote the finite difference term that comes from adding a small value
        to the observation corresponding to that elements respective row.
    term_minus : 2D ndarray.
        Should have one row for each observation. Should have one column for
        each parameter in the parameter vector being estimated. Elements should
        denote the finite difference term that comes from subtracting a small
        value to the observation corresponding to that elements respective row.
    epsilon : positive float.
        Should denote the 'very small' value being used to calculate the
        desired finite difference approximations to the various influence
        functions. Should be 'close' to zero.

    Returns
    -------
    empirical_influence : 2D ndarray.
        Should have one row for each observation. Should have one column for
        each parameter in the parameter vector being estimated. Elements should
        denote the empirical influence of the associated observation on the
        associated parameter.

    References
    ----------
    Efron, Bradley, and Robert J. Tibshirani. An Introduction to the Bootstrap.
        CRC press, 1994. Section 22.6, Equation 22.32.

    Notes
    -----
    This function is based off of the code in Efron's original Bootstrap
    library, written in S-plus. It is a finite difference, midpoint or slope
    approximation of Equation 22.32.
    """
    # Calculate the denominator of each row of the second order influence array
    denominator = 2 * epsilon
    # Calculate the empirical influence array.
    empirical_influence = np.zeros(term_plus.shape)
    diff_idx = ~np.isclose(term_plus, term_minus, atol=1e-12, rtol=0)
    if diff_idx.any():
        empirical_influence[diff_idx] =\
            (term_plus[diff_idx] - term_minus[diff_idx]) / denominator
    return empirical_influence
Calculates the finite difference, midpoint / slope approximation to the
    empirical influence array needed to compute the approximate boostrap
    confidence (ABC) intervals.

    Parameters
    ----------
    term_plus : 2D ndarray.
        Should have one row for each observation. Should have one column for
        each parameter in the parameter vector being estimated. Elements should
        denote the finite difference term that comes from adding a small value
        to the observation corresponding to that elements respective row.
    term_minus : 2D ndarray.
        Should have one row for each observation. Should have one column for
        each parameter in the parameter vector being estimated. Elements should
        denote the finite difference term that comes from subtracting a small
        value to the observation corresponding to that elements respective row.
    epsilon : positive float.
        Should denote the 'very small' value being used to calculate the
        desired finite difference approximations to the various influence
        functions. Should be 'close' to zero.

    Returns
    -------
    empirical_influence : 2D ndarray.
        Should have one row for each observation. Should have one column for
        each parameter in the parameter vector being estimated. Elements should
        denote the empirical influence of the associated observation on the
        associated parameter.

    References
    ----------
    Efron, Bradley, and Robert J. Tibshirani. An Introduction to the Bootstrap.
        CRC press, 1994. Section 22.6, Equation 22.32.

    Notes
    -----
    This function is based off of the code in Efron's original Bootstrap
    library, written in S-plus. It is a finite difference, midpoint or slope
    approximation of Equation 22.32.