def reg_n_correct(prediction, y, significance=None):
    """Calculates the number of correct predictions made by a conformal
    regression model.
    """
    if significance is not None:
        idx = int(significance * 100 - 1)
        prediction = prediction[:, :, idx]

    low = y >= prediction[:, 0]
    high = y <= prediction[:, 1]
    correct = low * high

    return y[correct].size