返回题库

固收 Yield Curve Bootstrap

Fi Yield Curve Bootstrap

专题
Algorithmic Programming / 算法编程
难度
L3
来源
MyntBit

题目详情

给定以下年度支付政府债券的票面利率:1 年期 4%,2 年期 5%,3 年期 6%。描述 bootstrap 过程确定第 1、2、3 年的零息利率。假设年度复利。

任务:Bootstrap 逐期推导:(1) 1年零息率 = 票面利率 = 4%;(2) 2年:100 = 5/(1+z1) + 105/(1+z2)² → z2 ≈ 5.025%;(3) 3年:100 = 6/(1+z1) + 6/(1+z2)² + 106/(1+z3)³ → z3 ≈ 6.078%。每期利用前面已求出的零息率推导下一期。

英文原题

You are given the following par rates for annual-pay government bonds:
1-year par rate: 4%
2-year par rate: 5%
3-year par rate: 6%
Describe the process of bootstrapping to determine the zero rates for years 1, 2, and 3. Assume annual compounding.

解析

问题分析

You are given the following par rates for annual-pay government bonds:
1-year par rate: 4%
2-year par rate: 5%
3-year par rate: 6%
Describe the process of bootstrapping to determine the zero rates for years 1, 2, and 3. Assume annual compounding.

解法

根据题目要求实现相应功能。核心逻辑需要:

// 核心数据结构和方法——根据题目 API 约定实现
// 1. 确定状态表示——选择支持所需操作的数据结构
// 2. 实现核心算法——确保 O(·) 时间复杂度和正确性
// 3. 处理边界条件——空输入、极值参数、并发访问

验证

用具体输入验证:构造已知输入的测试用例,确认输出匹配预期结果。

复杂度与边界

  • 时间复杂度:取决于选用的算法
  • 空间复杂度:取决于数据规模
  • 关键边界条件:空输入、极值参数、并发场景下的正确性保证

英文解析

Analysis

Bootstrapping constructs the zero-coupon (spot) yield curve from observed par rates. The key insight: a par bond's price equals 100 when its coupon rate equals the par rate. By iteratively solving for each zero rate using previously determined shorter-term zero rates, we build the full spot curve.

Given par rates: 1Y = 4%, 2Y = 5%, 3Y = 6%. We solve sequentially: the 1Y zero rate is simply the 1Y par rate (since a 1Y par bond has only one cash flow). Then the 2Y zero rate is found using the 1Y zero rate and the 2Y par bond equation. Finally the 3Y zero rate uses both prior zero rates.

Solution

Step 1: 1-year zero rate z1
A 1Y par bond: 100 = (100 + 4) / (1 + z1), so z1 = 0.04 (4%)

Step 2: 2-year zero rate z2
A 2Y par bond: 100 = 5 / (1 + z1) + 105 / (1 + z2)^2
100 = 5 / 1.04 + 105 / (1 + z2)^2
100 = 4.8077 + 105 / (1 + z2)^2
(1 + z2)^2 = 105 / 95.1923 = 1.1029
z2 = sqrt(1.1029) - 1 = 0.0507 (5.07%)

Step 3: 3-year zero rate z3
A 3Y par bond: 100 = 6 / 1.04 + 6 / (1.0507)^2 + 106 / (1 + z3)^3
100 = 5.7692 + 5.4849 + 106 / (1 + z3)^3
(1 + z3)^3 = 106 / 88.7459 = 1.1934
z3 = (1.1934)^(1/3) - 1 = 0.0614 (6.14%)

def bootstrap_zero_rates(par_rates, compounding='annual'):
    """Bootstrap zero rates from par rates using annual compounding."""
    zero_rates = []
    for n in range(1, len(par_rates) + 1):
        # Par bond equation: 100 = sum(c/(1+z_i)^i) + (100+c)/(1+z_n)^n
        c = par_rates[n-1] * 100  # coupon = par rate * 100
        pv_known = sum(c / (1 + zero_rates[i])**((i+1))
                       for i in range(n-1))
        residual = 100 - pv_known
        # Solve: residual = (100 + c) / (1 + z_n)^n
        z_n = ((100 + c) / residual)**(1/n) - 1
        zero_rates.append(z_n)
    return zero_rates

# Example: par_rates = [0.04, 0.05, 0.06]
# zero_rates = [0.04, 0.0507, 0.0614]

Complexity & Edge Cases

  • Time complexity: O(N^2) for N par rates (each step uses all prior zero rates)
  • Space complexity: O(N) for zero rate array
  • Edge cases: (1) Non-standard tenors (semi-annual coupons) require adjusted discount factors. (2) Missing data for some maturities requires interpolation. (3) Negative par rates (possible in some currencies) need careful handling. (4) Iterative methods needed when par bonds don't pay annual coupons on exact tenor dates.

Verification

Given: 1Y=4%, 2Y=5%, 3Y=6%

  • z1 = 4.00%
  • z2: 100 = 5/1.04 + 105/(1+z2)^2, so z2 = 5.07%
  • z3: 100 = 6/1.04 + 6/1.0507^2 + 106/(1+z3)^3, so z3 = 6.14%

Verification: 3Y par bond PV using zero rates:

  • 6/1.04 + 6/1.0507^2 + 106/1.0614^3 = 5.769 + 5.485 + 88.746 = 100 (correct)

Key Considerations

  • Bootstrapping produces zero rates that exceed par rates for upward-sloping curves (positive forward rates)
  • Interpolation between bootstrap points: linear, cubic spline, or monotone convex methods affect curve shape
  • The choice of compounding convention (annual, semi-annual, continuous) changes the numerical results
  • In practice, multiple instruments (deposits, futures, swaps) are combined to build the full curve