def _change_eff(i_rate1, piy1, piy2):
    """Convert rate expressed in terms of one effectivity to a different one.
    
    Change interest rate in terms of p1 periods in a year to a rate in terms of p2 periods in a year.
    
    :i_rate1: initial interest rate to be changed.
    :piy1: number of periods in a year for `i_rate1`
    :piy1: number of period in a year for the desired interest rate
    
    Uses this equivalence:
    
                 piy1                piy2
    (1 + i_rate1)     = (1 + i_rate2)
    """
    
    return (1 + i_rate1)**(piy1/piy2) - 1