The Bank of Orlen sets its policy rate i (the interest rate it pays and charges banks) by a published rule. Each quarter it looks at inflation \pi and the output gap y: how far output is above its normal (potential) level, as a fraction of it, so y = -0.02 means output is 2 % below normal. The rule is a Taylor rule:
where \pi^* is the inflation target, r^* the neutral real rate (the real rate that neither speeds up nor slows down the economy), and a, b say how strongly the bank reacts to inflation above target and to the gap. All rates are fractions (2 % is 0.02). The rule has no floor in this problem: report a negative rate as it comes out. In control terms, the rule is a proportional controller acting on two errors.
The real policy rate is i - \pi (the approximate Fisher relation, as the bank quotes it). A rule obeys the Taylor principle when, with the gap unchanged, any rise in inflation raises the nominal rate by more than the rise in inflation, so that the real rate goes up.
Write taylor_rates(r_star, pi_star, a, b, quarters) where quarters is a list of pairs (pi, y). Return a tuple (rates, reals, principle): the list of policy rates, the list of real policy rates (one per quarter, in order), and True if the rule obeys the Taylor principle, else False.
Examples
Input: r_star = 0.01, pi_star = 0.02, a = 0.5, b = 0.5,
quarters = [(0.02, 0.0), (0.04, 0.01), (0.01, -0.02)]
Output: ([0.03, 0.065, 0.005], [0.01, 0.025, -0.005], True)
Explanation: on target with no gap the rate is 0.01 + 0.02 = 0.03, a real rate of 0.01.
In the second quarter: 0.01 + 0.04 + 0.5 * 0.02 + 0.5 * 0.01 = 0.065.
Input: r_star = 0.01, pi_star = 0.02, a = -0.25, b = 0.5, quarters = [(0.02, 0.0), (0.06, 0.0)]
Output: ([0.03, 0.06], [0.01, 0.0], False)
Explanation: inflation rose by 0.04 but the rate only by 0.03, so the real rate fell.
Constraints
- answers are compared with a tolerance of
1e-6; do not round
Goals
- Evaluate a Taylor rule for the policy rate from inflation and the output gap
- Compute the real policy rate that the rule implies
- Decide whether a rule obeys the Taylor principle