Skip to content

15.3 通胀预期建模 ​

名词解释:通胀预期(Inflation Expectations)

通胀预期是市场参与者对未来物价水平变化率的预期,是资产定价的核心变量。通胀预期影响名义利率水平、债券定价和资产配置决策。量化通胀预期需要综合利用TIPS市场、通胀互换、调查数据和统计模型的交叉验证。

一、盈亏平衡通胀率(BEI) ​

1.1 BEI 的定义与定价 ​

盈亏平衡通胀率(Break-Even Inflation rate, BEI)定义为同期限名义国债收益率与 TIPS(通胀保护国债)收益率之差:

BEI(T)=ynominal(T)−yTIPS(T)

BEI 分解为两个成分:

BEI=E[π]+IRP

其中 E[π] 是真实通胀预期,IRP 是通胀风险溢价(Inflation Risk Premium)。

1.2 从市场数据提取 BEI ​

PYTHON91 行 · 3.1 KB
📄此处有展示代码91 行 · 3.1 KB展开 ▼
python
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt

def calculate_bei(nominal_yields: pd.DataFrame,
                   tips_yields: pd.DataFrame) -> pd.DataFrame:
    """
    计算各期限的盈亏平衡通胀率。

    参数:
        nominal_yields: 名义国债收益率,列为各期限
        tips_yields: TIPS收益率,列为各期限
    返回:
        BEI DataFrame
    """
    # 对齐期限
    common_tenors = nominal_yields.columns.intersection(tips_yields.columns)
    bei = nominal_yields[common_tenors] - tips_yields[common_tenors]
    bei.columns = [f'BEI_{c}' for c in common_tenors]

    return bei


def bei_term_structure(bei_latest: pd.Series) -> dict:
    """
    分析BEI的期限结构及其隐含信息。

    参数:
        bei_latest: 最新的BEI曲线(不同期限的BEI值)
    """
    tenors = np.array([float(str(c).replace('BEI_', '').replace('Y', ''))
                       for c in bei_latest.index])
    bei_values = bei_latest.values

    # 拟合曲线
    f = interp1d(tenors, bei_values, kind='cubic', fill_value='extrapolate')

    # 计算关键指标
    bei_5y = f(5)
    bei_10y = f(10)
    bei_30y = f(30)

    # 5年5年远期BEI
    bei_5y5y = ((1 + bei_10y / 100) ** 10 /
                (1 + bei_5y / 100) ** 5) ** (1/5) - 1
    bei_5y5y *= 100  # 转百分比

    # 通胀风险溢价(简化估计:长端BEI - 短期调查通胀预期)
    survey_lt_inflation = 2.0  # 简化:假设长期通胀预期调查为2%
    irp_estimate = bei_5y5y - survey_lt_inflation

    # 可视化
    fig, ax = plt.subplots(figsize=(10, 6))
    tenors_dense = np.linspace(1, 30, 100)
    bei_dense = f(tenors_dense)

    ax.plot(tenors_dense, bei_dense, 'b-', linewidth=2, label='BEI 拟合曲线')
    ax.scatter(tenors, bei_values, color='red', s=80, zorder=5,
               label='市场数据')
    ax.axhline(y=2.0, color='green', linestyle='--',
               label='美联储通胀目标 (2%)')
    ax.fill_between(tenors_dense, bei_dense, 2.0,
                     where=(bei_dense > 2.0),
                     alpha=0.2, color='red', label='通胀预期高于目标')
    ax.set_xlabel('期限(年)')
    ax.set_ylabel('BEI (%)')
    ax.set_title('盈亏平衡通胀率期限结构')
    ax.legend()
    ax.grid(True, alpha=0.3)
    plt.show()

    return {
        'BEI_5Y': bei_5y,
        'BEI_10Y': bei_10y,
        'BEI_30Y': bei_30y,
        'BEI_5Y5Y_forward': bei_5y5y,
        'IRP_estimate': irp_estimate,
        'term_premium_signal': 'steepening' if bei_30y > bei_5y else 'flattening'
    }

# ===== 合成数据最小示例(数据为模拟,机制真实)=====
np.random.seed(5)
_tenors = ['1Y', '2Y', '5Y', '10Y', '30Y']
_idx = pd.date_range('2024-01-31', periods=12, freq='ME')
_nom = pd.DataFrame({t: 4.0 + i * 0.05 + np.random.randn(12) * 0.05 for i, t in enumerate(_tenors)}, index=_idx)
_tips = pd.DataFrame({t: 1.9 + i * 0.04 + np.random.randn(12) * 0.04 for i, t in enumerate(_tenors)}, index=_idx)
_bei = calculate_bei(_nom, _tips)
print('BEI(盈亏平衡通胀率):')
print(_bei.head() if hasattr(_bei, 'head') else _bei)
▶ 点击展开可浏览运行结果
BEI(盈亏平衡通胀率):
              BEI_1Y    BEI_2Y    BEI_5Y   BEI_10Y   BEI_30Y
2024-01-31  2.139490  2.019204  2.129085  2.157700  2.172479
2024-02-29  2.044569  2.157255  2.113167  2.216027  2.105891
2024-03-31  2.231167  2.073349  2.151376  2.105914  2.208832
2024-04-30  2.120360  2.130874  2.110442  2.188057  2.170548
2024-05-31  2.082755  2.132663  2.150595  2.083010  2.041816

二、TIPS 与名义国债定价 ​

2.1 TIPS 的特殊性 ​

TIPS(Treasury Inflation-Protected Securities)的本金随 CPI-U 指数调整,提供了对通胀的直接保护。TIPS 相对名义国债的关键特征:

  • 通缩保护:到期时至少返还原始本金(deflation floor)
  • 流动性差异:TIPS 市场的流动性显著低于名义国债市场
  • 税收处理:本金调整在当期征税(phantom income),影响应税投资者的定价

2.2 TIPS 公允价值的分解模型 ​

PYTHON57 行 · 2.0 KB
📄此处有展示代码57 行 · 2.0 KB展开 ▼
python
import numpy as np

def tips_fair_value(real_yield: float,
                     expected_inflation: np.ndarray,
                     inflation_volatility: float = 0.015,
                     maturity_years: int = 10,
                     nominal_par: float = 1000.0) -> float:
    """
    计算TIPS的理论公允价值。

    TIPS价格 = 预期通胀调整后的现金流现值 + 通缩保护期权价值

    参数:
        real_yield: 实际收益率(小数形式,如0.01=1%)
        expected_inflation: 未来各期的预期通胀率数组
        inflation_volatility: 通胀的年度波动率
        maturity_years: 到期年数
        nominal_par: 名义本金
    返回:
        TIPS理论价格
    """
    n_periods = len(expected_inflation)

    # 计算通胀调整后的本金路径
    inflation_index = np.cumprod(1 + expected_inflation)
    inflation_index = np.insert(inflation_index, 0, 1.0)

    # 票息(假设固定票息率)
    coupon_rate = real_yield  # 简化:实际收益率 = 票息率
    coupon = nominal_par * coupon_rate

    # 贴现因子
    discount_factors = (1 + real_yield) ** (-np.arange(1, n_periods + 1))

    # 通胀调整后的现金流
    pv_coupons = np.sum(
        coupon * inflation_index[1:] * discount_factors
    )
    pv_principal = nominal_par * inflation_index[-1] * \
        (1 + real_yield) ** (-n_periods)

    # 通缩保护期权的价值(简化:Black-Scholes类型估值)
    # 在到期日,回报为 max(Par - Adjusted Principal, 0)
    # 简化估计:通胀低于某个阈值的概率
    deflation_prob = np.mean(expected_inflation < 0)  # 负通胀概率
    floor_value = nominal_par * deflation_prob * \
        (1 + real_yield) ** (-n_periods) * 0.5

    fair_value = pv_coupons + pv_principal + floor_value

    return fair_value

# ===== 合成数据最小示例(数据为模拟,机制真实)=====
_exp_inf = np.full(10, 0.025)
print('TIPS 公平价值:',
      round(tips_fair_value(real_yield=2.0, expected_inflation=_exp_inf, maturity_years=10), 2))
▶ 点击展开可浏览运行结果
TIPS 公平价值: 1037.97

三、通胀互换与通胀衍生品 ​

3.1 零息通胀互换(ZCIS) ​

零息通胀互换是最基础的通胀衍生品。合约双方交换:

  • 通胀端(Inflation Leg):支付 N×(ITI0−1)
  • 固定端(Fixed Leg):支付 N×((1+K)T−1)

其中 It 是参考CPI指数,K 是互换利率(零息通胀互换利率)。

PYTHON35 行 · 1.1 KB
📄此处有展示代码35 行 · 1.1 KB展开 ▼
python
def zcis_fair_rate(expected_cpi_path: np.ndarray,
                    discount_rates: np.ndarray,
                    maturity_years: float) -> float:
    """
    计算零息通胀互换的公平固定利率。

    公平条件:固定端的PV = 通胀端的PV

    参数:
        expected_cpi_path: 预期的CPI指数路径
        discount_rates: 对应期限的贴现率
        maturity_years: 到期年数
    返回:
        零息通胀互换利率 K
    """
    T = int(maturity_years)
    I_0 = expected_cpi_path[0]
    I_T = expected_cpi_path[-1]

    # 通胀端PV
    inflation_pv = (I_T / I_0 - 1) * (1 + discount_rates[-1]) ** (-T)

    # 求解 K 使得固定端PV = 通胀端PV
    # PV_fixed = ((1+K)^T - 1) * DF_T = PV_inflation
    df_T = (1 + discount_rates[-1]) ** (-T)
    K = (inflation_pv / df_T + 1) ** (1 / T) - 1

    return K

# ===== 合成数据最小示例(数据为模拟,机制真实)=====
_cpi_path = np.full(10, 0.024)
_disc = np.full(10, 0.042)
print('10 年期 ZCIS 公平利率:',
      round(zcis_fair_rate(expected_cpi_path=_cpi_path, discount_rates=_disc, maturity_years=10), 4))
▶ 点击展开可浏览运行结果
📘 本段代码定义了 1 个函数/类:函数 `zcis_fair_rate`(计算零息通胀互换的公平固定利率)。该片段为教学展示(未包含独立运行的输入数据),可在实战练习中结合真实数据调用。

3.2 通胀上限/下限期权(Inflation Caps/Floors) ​

通胀上限(Cap)为买方提供了通胀上升时的保护,每期支付为:

Payofft=max(It/It−1−1−K,0)×N

四、通胀因子在资产配置中的应用 ​

4.1 通胀敏感性分析 ​

不同资产类别对通胀的敏感度差异显著:

资产类别通胀敏感度机制
TIPS直接正敏感本金随CPI调整
商品(黄金、原油)正敏感实物资产对冲通胀
长期名义国债负敏感通胀侵蚀固定收益
权益(价值股)中性到正定价权较强的公司可转嫁成本
权益(成长股)负敏感远期的现金流被高通胀折现
REITs正敏感租金和物业价值随通胀上升

4.2 通胀对冲组合构建 ​

PYTHON50 行 · 1.8 KB
📄此处有展示代码50 行 · 1.8 KB展开 ▼
python
def inflation_hedge_portfolio(inflation_regime: str,
                               risk_budget: float = 0.10) -> dict:
    """
    基于通胀环境构建对冲组合。

    参数:
        inflation_regime: 通胀环境
            - 'rising': 通胀上升
            - 'falling': 通胀下降/通缩
            - 'stable_high': 高通胀但稳定
            - 'stable_low': 低通胀且稳定
        risk_budget: 分配给通胀对冲的风险预算
    返回:
        对冲组合的资产配置权重
    """
    # 各资产在不同通胀环境下的配置权重
    hedge_allocation = {
        'rising': {
            'TIPS': 0.30, '黄金': 0.15, '商品期货': 0.20,
            '大宗商品股票': 0.15, '浮动利率债券': 0.10,
            'REITs': 0.05, '现金': 0.05
        },
        'falling': {
            '名义长期国债': 0.40, '投资级公司债': 0.25,
            '成长股': 0.15, 'TIPS': 0.10, '现金': 0.10
        },
        'stable_high': {
            'TIPS': 0.25, 'REITs': 0.20, '价值股': 0.15,
            '基础设施': 0.15, '商品': 0.10, '浮动利率债券': 0.15
        },
        'stable_low': {
            '名义国债': 0.20, '投资级公司债': 0.25,
            '成长股': 0.30, '高质量股利股': 0.15, 'TIPS': 0.10
        }
    }

    # 获取对应配置
    weights = hedge_allocation.get(inflation_regime,
                                    hedge_allocation['stable_low'])

    # 按风险预算缩放
    scaled_weights = {k: v * risk_budget for k, v in weights.items()}

    return scaled_weights

# ===== 合成数据最小示例(数据为模拟,机制真实)=====
for _reg in ['rising', 'falling', 'stable_high', 'stable_low']:
    _w = inflation_hedge_portfolio(inflation_regime=_reg, risk_budget=0.10)
    print(_reg, '->', {k: round(v, 3) for k, v in _w.items()})
▶ 点击展开可浏览运行结果
rising -> {'TIPS': 0.03, '黄金': 0.015, '商品期货': 0.02, '大宗商品股票': 0.015, '浮动利率债券': 0.01, 'REITs': 0.005, '现金': 0.005}
falling -> {'名义长期国债': 0.04, '投资级公司债': 0.025, '成长股': 0.015, 'TIPS': 0.01, '现金': 0.01}
stable_high -> {'TIPS': 0.025, 'REITs': 0.02, '价值股': 0.015, '基础设施': 0.015, '商品': 0.01, '浮动利率债券': 0.015}
stable_low -> {'名义国债': 0.02, '投资级公司债': 0.025, '成长股': 0.03, '高质量股利股': 0.015, 'TIPS': 0.01}

4.3 BEI 变化率的交易信号 ​

BEI 的变化率(而非水平值)是更有效的短期交易信号。当 BEI 加速上升时,表明市场正在快速重估通胀前景:

PYTHON38 行 · 1.2 KB
📄此处有展示代码38 行 · 1.2 KB展开 ▼
python
import numpy as np
import pandas as pd

def bei_momentum_signal(bei_time_series: pd.Series,
                         short_window: int = 5,
                         long_window: int = 20) -> float:
    """
    BEI 动量信号。

    正值表示通胀预期上升动能,建议做多通胀敏感资产;
    负值表示通胀预期下降动能。

    参数:
        bei_time_series: BEI 时间序列(如10年期)
        short_window: 短期窗口(天)
        long_window: 长期窗口(天)
    返回:
        信号值 [-1, 1]
    """
    short_ma = bei_time_series.rolling(short_window).mean()
    long_ma = bei_time_series.rolling(long_window).mean()

    # 短均线 - 长均线,标准化
    raw_signal = (short_ma.iloc[-1] - long_ma.iloc[-1]) / \
                 bei_time_series.rolling(long_window).std().iloc[-1]

    # 限制在 [-2, 2],然后映射到 [-1, 1]
    signal = np.clip(raw_signal / 2, -1, 1)

    return signal

# ===== 合成数据最小示例(数据为模拟,机制真实)=====
np.random.seed(9)
_s = pd.Series(2.3 + np.cumsum(np.random.randn(120) * 0.05),
               index=pd.date_range('2023-01-31', periods=120))
_sig = bei_momentum_signal(_s)
print(_sig.tail() if hasattr(_sig, 'tail') else _sig)
▶ 点击展开可浏览运行结果
0.4818949016094894

通胀预期是连接宏观经济和资产定价的关键枢纽。理解通胀的动态变化和期限结构不仅有助于债券定价,也是经济周期择时的核心输入变量——因为通胀的拐点通常标志着经济周期的转折。

常见误区 ​

误区1:把盈亏平衡通胀率直接当通胀预期。 BEI = 预期通胀 + 通胀风险溢价 + TIPS 流动性溢价差,三者不可直接分离。

误区2:TIPS 久期与名义债相同。 票息本金随 CPI 指数化,真实久期通常短于同期限名义债,用错久期会高估利率风险。

误区3:通胀互换无信用风险就无其他风险。 互换虽然消除信用风险,但存在流动性风险与保证金占用,压力时期基差可能大幅走阔。

误区4:通胀对所有资产的影响同质。 非预期通胀伤害名义债与成长股,但利好实物资产、浮息债与价值股,需分资产评估。

本章要点 ​

  • BEI = 名义国债收益率 − TIPS 实际收益率,是市场定价的通胀预期
  • 通胀互换与 BEI 之差主要反映流动性溢价与技术性因素
  • 配置工具箱:TIPS、商品、浮息债在不同通胀阶段弹性不同
  • 通胀因子进入资产配置需区分已预期与超预期部分

跨模块延伸:风险平价