def corbsub(isub, x, y, corfun, *args):
    """
    Compute correlation for x[isub] and y[isub]
    isub is a vector of length n,
    a bootstrap sample from the sequence of integers
    0, 1, 2, 3, ..., n

    This function is used by other functions when computing
    bootstrap estimates.

    corfun is some correlation function
    """
    corbsub_results = corfun(x[isub], y[isub], *args)['cor']
    return corbsub_results
