def predicted_retention(alpha, beta, t):
    """
    Generate the retention probability r at period t, the probability of customer to be active at the
    end of period t−1 who are still active at the end of period t.
    Implementing the formula in equation (8).
    """
    assert t > 0, "period t should be positive"
    return (beta + t) / (alpha + beta + t)