# 仿射期限结构模型：理论与实现——理论部分

## 1 引言

1. 为一组债券价格拟合即期利率曲线。
2. 模拟利率期限结构的动态过程。

1. 模型能反映期限结构的动态特征。
2. 存在解析表达式。
3. 参数容易估计。

## 2 理论发展

### 2.1 一些关键利率的关系

$z(t,T) = -\frac{\ln P(t,T)}{T-t}$

$r(t) = \lim_{T \to t} z(t,T) = -\frac{\partial \ln P(t,t)}{\partial t}$

$P(t,T) = E(e^{-\int_t^T r(s)ds}|\mathcal{F}_t)$

### 2.2 仿射模型的基本结构

$d y(t) = A_0 dt + A_1 d W(t)$

$A_1^2$ 与 PDE 中的二次导数项相伴而生，故而要求 $A_1^2$ 是仿射形式的。

• Vasicek, O. (1977): "An Equilibrium Characterization of the Term Structure," Journal of Financial Economics, 5, 177–188.
• Cox, J. C., J. E. Ingersoll, and S. A. Ross (1985a): "An Intertemporal General Equilibrium Model of Asset Prices," Econometrica, 53, 363–384.
• Cox, J. C., J. E. Ingersoll, and S. A. Ross (1985b): "A Theory of Term Structure of Interest Rates," Econometrica, 53, 385–407.
• Longstaff, F. A., and E. S. Schwartz (1992a): "Interest Rate Volatility and the Term Structure: A Two-Factor General Equilibrium Model," The Journal of Finance, XLVII, 1259–1282.
• Longstaff, F. A., and E. S. Schwartz (1992b): "A Two-Factor Interest Rate Model and Contingent Claims Evaluation," The Journal of Fixed Income, pp. 16–23.
• Duffie, D., and R. Kan (1996): "A Yield-Factor Model of Interest Rates," Mathematical Finance, 6, 379-406.

• 对当前观测到的期限结构数据拟合不佳。事实上，仿射模型关注的是期限结构的时间序列特性，而不是横截面（cross-sectional）特性。
• 仿射模型是内在“线性的”。即期利率与状态变量之间是线性关系。

### 2.3 单因子模型

$d r(t) = f(r,t) dt + \rho(r,t) dW(t)$

$r(t)$ 的马尔可夫性，$P (t, T)$ 将是 $r(t)$ 的函数：

\begin{aligned} P(t,T)&=P(t,T, r)\\ d P(t,T,r) &= \left(P_t + f P_r + \frac{\rho^2}{2}P_{rr} \right)dt + \rho P_r d W(t) \end{aligned}

\begin{aligned} V &= P_1 + h P_2\\ dV &= d P_1 + h d P_2 \end{aligned}

$d P = \mu dt + \sigma dW$

\begin{aligned} dV &= d P_1 + h d P_2\\ &= \mu_1 dt + \sigma_1 dW + h(\mu_2 dt + \sigma_2 dW) \end{aligned}

\begin{aligned} dV &= d P_1 + h d P_2\\ &= \left( \mu_1 - \frac{\sigma_1}{\sigma_2} \mu_2 \right)dt\\ \end{aligned}

$dV = rVdt$

$\mu_1 - \frac{\sigma_1}{\sigma_2} \mu_2 = r\left(P_1 - \frac{\sigma_1}{\sigma_2} P_2\right)$

$\frac{\mu_1 - rP_1}{\sigma_1} = \frac{\mu_2 - rP_2}{\sigma_2}$

$P_t + (f-\rho \lambda(t,r))P_r + \frac{\rho^2}{2}P_{rr} - rP=0$

\begin{aligned} d r(t) &= \kappa(\theta -r(t))dt + \sigma dW\\ P(\tau, r) &= \exp(A(\tau)-B(\tau)r)\\ B(\tau) &= \frac{1}{\kappa}(1-e^{-\kappa r})\\ A(\tau) & = \frac{\gamma(B(\tau)-\tau)}{\kappa^2}-\frac{\sigma^2 B(\tau)^2}{4\kappa}\\ \gamma &= \kappa^2 \left(\theta-\frac{\sigma \lambda}{\kappa} \right) - \frac{\sigma^2}{2} \end{aligned}

\begin{aligned} d r(t) &= \kappa(\theta -r(t))dt + \sigma \sqrt{r(t)} dW\\ P(\tau, r) &= \exp(A(\tau)-B(\tau)r)\\ B(\tau) &= \frac{2(e^{\gamma\tau}-1)}{(\gamma+\kappa+\lambda)(e^{\gamma\tau}-1)+2\gamma}\\ A(\tau) &= {\frac{2\kappa\theta}{\sigma^2}}\ln \left( \frac{2\gamma e^{\frac{(\gamma+\kappa+\lambda)\tau}{2}}}{(\gamma+\kappa+\lambda)(e^{\gamma\tau}-1)+2\gamma} \right)\\ \gamma &= \sqrt{(\kappa+\lambda)^2+2\sigma^2} \end{aligned}

### 2.4 多因子模型

$r = \sum_{i=1}^n y_i$

$d y_i(t) = f_i(y_i,t) dt + \rho_i(y_i,t) dW_i(t)$

$dP_i = \mu_i dt + \sigma_i^T \times dW$

$W$$n$ 维布朗运动，$d W_i dW_j = \rho_{i,j}dt$

$n+1$ 个不同期限的债券构造自融资组合：

\begin{aligned} dV &= d P_0 + h^T \times d P\\ &= \mu_0 dt + \sigma_0^T \times dW + h^T \times \mu dt + h^T \times \sigma \times dW\\ \mu &= [\mu_1,\dots,\mu_n]^T\\ dW &= [dW_1,\dots,dW_n]^T\\ \sigma &= \begin{bmatrix} \sigma_{1,1} & \cdots & \sigma_{1,n}\\ \vdots & & \vdots \\ \sigma_{n,1} & \cdots & \sigma_{n,n} \end{bmatrix} \end{aligned}

$h = -(\sigma^T)^{-1} \times \sigma_0$

\begin{aligned} dV &= d P_0 + h^T \times d P\\ &= \left(\mu_0 - \sigma_0^T \times \sigma^{-1} \times\mu \right)dt\\ \end{aligned}

$dV = rVdt$

$\mu_0 - rP_0 = \sigma_0^T \times \sigma^{-1} \times(\mu - rP)$

$\sigma^{-1} \times(\mu - rP)$

$P_t + \sum_{i} P_{y_i}f_i + \frac{1}{2}\sum_{i,j}P_{y_i,y_j}\rho_i \rho_j \rho_{i,j} - \sum_i P_{y_i}\rho_i \lambda_i - rP = 0$

\begin{aligned} d y_i(t) &= \kappa_i(\theta_i -y_i(t))dt + \sigma_i dW_i\\ P(\tau, y) &= \exp(A(\tau)-\sum_{i=1}^n B_i(\tau)y_i)\\ B_i(\tau) &= \frac{1}{\kappa_i}(1-e^{-\kappa_i \tau})\\ A(\tau) & = \sum_{i=1}^n \frac{\gamma_i(B_i(\tau)-\tau)}{\kappa_i^2}-\frac{\sigma_i^2 B(\tau)^2}{4\kappa_i}\\ \gamma_i &= \kappa_i^2 \left(\theta_i-\frac{\sigma_i \lambda}{\kappa_i} \right) - \frac{\sigma_i^2}{2} \end{aligned}

$W$$n$ 维标准布朗运动，$\lambda$ 是常数。

\begin{aligned} d y_i(t) &= \kappa_i(\theta_i -y_i(t))dt + \sigma_i \sqrt{y_i(t)} dW_i\\ P(\tau, y) &= \exp(A(\tau)-\sum_{i=1}^n B_i(\tau)y_i)\\ B_i(\tau) &= \frac{2(e^{\gamma_i\tau}-1)}{(\gamma_i+\kappa_i+\lambda_i)(e^{\gamma_i\tau}-1)+2\gamma_i}\\ A(\tau) &= \sum_{i=1}^n{\frac{2\kappa_i\theta_i}{\sigma_i^2}}\ln \left( \frac{2\gamma_i e^{\frac{(\gamma_i+\kappa_i+\lambda_i)\tau}{2}}}{(\gamma_i+\kappa_i+\lambda_i)(e^{\gamma_i\tau}-1)+2\gamma_i} \right)\\ \gamma_i &= \sqrt{(\kappa_i+\lambda_i)^2+2\sigma_i^2} \end{aligned}

$W$$n$ 维标准布朗运动，$\lambda$ 是常数。

## 3 模型实现

### 3.1 卡尔曼滤波简介

• Duan, J.-C., and J.-G. Simonato (1995): "Estimating and Testing Exponential-Affine Term Structure Models by Kalman Filter," Discussion paper, Centre universitaire de recherche et analyze des organizations (CIRANO).
• Lund, J. (1997): "Econometric Analysis of Continuous-Time Arbitrage-Free Models of the Term Structure of Interest Rates," Department of Finance, The Aarhus School of Business.
• Geyer, A. L. J., and S. Pichler (1998): "A State-Space Approach to Estimate and Test Multifactor Cox-Ingersoll-Ross Models of the Term Structure of Interest Rates," Department of Operations Research, University of Economics Vienna.
• de Jong, F. (1998): "Time-Series and Cross-Section Information in Affine Term Structure Models," Department of Financial Management, University of Amsterdam.
• Babbs, S. H., and K. B. Nowman (1999): "Kalman Filtering of Generalized Vasicek Term Structure Models," Journal of Financial and Quantitative Analysis, pp. 115–130.

• 观测系统指零息利率与状态变量之间的关系，
• 转移系统指状态变量的动态过程。

### 3.2 状态空间表示

$n$ 个零息利率 $z_1,\dots,z_n$ 的期限分别是 $t_{z_1},\dots,t_{z_n}$$z(s,T)$ 表示 $s$ 时观测到的期限为 $T$ 的即期利率。

\begin{aligned} z_{t_i} &= A + H y_{t_i} + \nu_{t_i}\\ y_{t_i} &= C + F y_{t_{i-1}} + \varepsilon_{t_i} \end{aligned}

Vasicek 模型和 CIR 模型的观测系统表达式：

$\begin{bmatrix} z(t_i,t_{z_1}) \\ \vdots\\ z(t_i,t_{z_n}) \end{bmatrix}= \begin{bmatrix} \frac{-A(t_i,t_{z_1})}{t_{z_1} - t_i} \\ \vdots\\ \frac{-A(t_i,t_{z_n})}{t_{z_n} - t_i} \end{bmatrix}+ \begin{bmatrix} \frac{B_1(t_i,t_{z_1})}{t_{z_1} - t_i}&\frac{B_2(t_i,t_{z_1})}{t_{z_1} - t_i}&\frac{B_3(t_i,t_{z_1})}{t_{z_1} - t_i}\\ \vdots&\vdots&\vdots\\ \frac{B_1(t_i,t_{z_n})}{t_{z_n} - t_i}&\frac{B_2(t_i,t_{z_n})}{t_{z_n} - t_i}&\frac{B_3(t_i,t_{z_n})}{t_{z_n} - t_i} \end{bmatrix} \begin{bmatrix} y_1(t_i) \\ y_2(t_i) \\ y_3(t_i) \end{bmatrix}+ \begin{bmatrix} \nu_1(t_i) \\ \vdots\\ \nu_n(t_i) \end{bmatrix}$

$\nu \sim N(0,R)$ 是相互独立的观测误差。

Vasicek 模型的转移系统：

$y_j(t_i) = \theta_j(1-e^{-\kappa_j \Delta t}) + e^{-\kappa_j \Delta t} y_j(t_{i-1}) + \varepsilon_j(t_i),j=1,2,3$

$\varepsilon_j(t_i) \sim N(0, \sqrt{\frac{\sigma_j^2}{2\kappa_j}\left(1-e^{-2\kappa_j \Delta t}\right)})$

CIR 模型的转移系统：

$y_j(t_i) = \theta_j(1-e^{-\kappa_j \Delta t}) + e^{-\kappa_j \Delta t} y_j(t_{i-1}) + \varepsilon_j(t_i),j=1,2,3$

$\varepsilon_j(t_i) \sim N(0, \sqrt{ \frac{\theta_j\sigma_j^2}{2\kappa_j}\left(1-e^{-2\kappa_j \Delta t}\right)^2 + \frac{\sigma_j^2}{\kappa_j}(e^{-\kappa_j \Delta t}-e^{-2\kappa_j \Delta t})y_i(t_{i-1})})$

CIR 的真实转移概率分布是一个非中心 $\chi^2$ 分布，但 Ball and Torous (1996) 指出在足够小的时间区间上可以用正态分布近似。

### 3.3 实现细节

$\mathcal{F}_s$ 是观测系统的 $\sigma$ 代数

$\mathcal{F}_{t_i} = \sigma \{z_{t_0}, z_{t_1},\dots,z_{t_i}\}$

Step 1：初始化状态向量

$E[y_1] = E[y_1|\mathcal{F}_0] = \theta$

$var[y_1] = var[y_1|\mathcal{F}_0] = diag(\frac{\sigma^2}{2 \kappa})$

$var[y_1] = var[y_1|\mathcal{F}_0] = diag(\frac{\sigma^2 \theta}{2 \kappa})$

Step 2：预测观测值

\begin{aligned} E[z_{t_i}|\mathcal{F}_{t_{i-1}}] &= A + H \cdot E[y_{t_i}|\mathcal{F}_{t_{i-1}}]\\ var[z_{t_i}|\mathcal{F}_{t_{i-1}}] &= H \cdot var[y_{t_i}|\mathcal{F}_{t_{i-1}}] \cdot H^T + R \end{aligned}

Step 3：更新状态向量的推断

$\zeta_{t_i} = z_{t_i} - E[z_{t_i}|\mathcal{F}_{t_{i-1}}]$

\begin{aligned} E[y_{t_i}|\mathcal{F}_{t_{i}}] &= E[y_{t_i}|\mathcal{F}_{t_{i-1}}] + K_{t_i}\zeta_{t_i}\\ K_{t_i} &= var[z_{t_i}|\mathcal{F}_{t_{i-1}}] \cdot H^T \cdot var[z_{t_i}|\mathcal{F}_{t_{i-1}}]^{-1} \end{aligned}

$K_{t_i}$ 称为卡尔曼获得矩阵。获得矩阵决定了更新预测时新观测数据的权重。条件方差也要更新。

$var[z_{t_i}|\mathcal{F}_{t_{i}}] = (I - K_{t_i}H)var[z_{t_i}|\mathcal{F}_{t_{i-1}}]$

Step 4：预测状态向量

\begin{aligned} E[y_{t_{i+1}}|\mathcal{F}_{t_{i}}] &= C + F \cdot E[y_{t_i}|\mathcal{F}_{t_{i}}]\\ var[y_{t_{i+1}}|\mathcal{F}_{t_{i}}] &= var[y_{t_i}|\mathcal{F}_{t_{i-1}}] - F \cdot var[y_{t_i}|\mathcal{F}_{t_{i}}] \cdot F^T + Q \end{aligned}

Step 5：构造似然函数

$l(\theta) = -\frac{nN\ln(2\pi)}{2} - \frac12 \sum_{i=1}^N\left[ \ln\left( \det(var[z_{t_i}|\mathcal{F}_{t_{i-1}}])\right) + \zeta^T_{t_i}var[z_{t_i}|\mathcal{F}_{t_{i-1}}]^{-1}\zeta_{t_i} \right]$

### 3.4 模拟计算

1. 模拟期限结构路径，状态变量还可以用 SDE 的离散化模拟。
2. 以任意参数开始，用 Broyden-Fletcher-Goldfarb-Shanno（BFGS）算法找到最大化对数似然函数的参数。
3. 反复运行 250 次。

### 3.5 应用于真实数据

$\psi_i = \sqrt{H^{-1}_{ii}}$

$H$ 是 Hessian 矩阵。

## 其他相关文献

Ball, C. A., and W. N. Torous (1996): "Unit Roots and the Estimation of Interest Rate Dynamics," Journal of Empirical Finance, 3, 215–238.

Chen, R., Scott, L. Multi-Factor Cox-Ingersoll-Ross Models of the Term Structure: Estimates and Tests from a Kalman Filter Model. The Journal of Real Estate Finance and Economics 27, 143–172 (2003).

## 延伸阅读

《仿射期限结构模型：理论与实现——实现部分》

posted @ 2020-04-06 10:10  xuruilong100  阅读(...)  评论(...编辑  收藏