5D Library › 期权隐含波动率曲面、偏度溢价与垂直价差结构的定量风控 · English

第一章 布莱克—斯科尔斯—默顿定价与隐含波动率的反解

一个公式,五个输入

1973 年,布莱克与斯科尔斯发表了欧式期权的定价公式 (Black and Scholes 1973);同一年,默顿把它推广到支付连续股息的标的,并证明了一组与模型无关的价格界限,其中之一是:标的不付股息时,美式看涨期权永远不应提前行权,所以它的价格等于欧式看涨期权 (Merton 1973)。这个公式的思路是:在标的价格服从几何布朗运动、可以无摩擦地连续交易、利率与波动率为常数的假设下,用标的与无风险资产可以连续复制期权的收益,所以期权的价格不取决于投资者的风险偏好,也不取决于标的的期望收益率。

设标的现价 SS,行权价 KK,剩余期限 TT(年),无风险利率 rr,连续股息率 qq,波动率 σ\sigma,则

C=Se−qTN(d1)−Ke−rTN(d2),P=Ke−rTN(−d2)−Se−qTN(−d1),C = S e^{-qT} N(d_1) – K e^{-rT} N(d_2), \qquad P = K e^{-rT} N(-d_2) – S e^{-qT} N(-d_1),

d1=ln⁡(S/K)+(r−q+σ2/2)TσT,d2=d1−σT.d_1 = \frac{\ln(S/K) + (r – q + \sigma^2/2)T}{\sigma\sqrt{T}}, \qquad d_2 = d_1 – \sigma\sqrt{T}.

其中 N(⋅)N(\cdot) 是标准正态分布函数。Python 标准库没有现成的 NN,但 N(x)=12[1+erf(x/2)]N(x) = \tfrac12[1 + \mathrm{erf}(x/\sqrt2)],math.erf 就够用。五个输入中,只有 σ\sigma 不能直接观察,这正是「隐含波动率」的由来。

下面的程序计算一组示意参数下的价格,检查看涨—看跌平价 C−P=Se−qT−Ke−rTC – P = Se^{-qT} – Ke^{-rT},并用考克斯、罗斯与鲁宾斯坦的二叉树 (Cox et al. 1979) 看离散模型怎样收敛到公式。最后一部分比较平值远期期权(K=SerTK = Se^{rT})的精确价格与近似式 C≈0.3989SσTC \approx 0.3989\,S\sigma\sqrt{T},它是下一节平值近似的来源。

推导

# Black-Scholes-Merton prices with the normal CDF from math.erf, put-call parity, the
# Cox-Ross-Rubinstein tree converging to the formula, and the at-the-money shortcut.
# Illustrative parameters, not market quotes.
import math

def ncdf(x):
    return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))

def bsm(S, K, T, r, sig, q=0.0, kind="call"):
    d1 = (math.log(S / K) + (r - q + 0.5 * sig * sig) * T) / (sig * math.sqrt(T))
    d2 = d1 - sig * math.sqrt(T)
    if kind == "call":
        return S * math.exp(-q * T) * ncdf(d1) - K * math.exp(-r * T) * ncdf(d2)
    return K * math.exp(-r * T) * ncdf(-d2) - S * math.exp(-q * T) * ncdf(-d1)

def crr(S, K, T, r, sig, n, kind="put", american=False):
    dt = T / n
    u = math.exp(sig * math.sqrt(dt)); d = 1 / u
    p = (math.exp(r * dt) - d) / (u - d); disc = math.exp(-r * dt)
    pay = (lambda s: max(K - s, 0.0)) if kind == "put" else (lambda s: max(s - K, 0.0))
    v = [pay(S * u ** j * d ** (n - j)) for j in range(n + 1)]
    for i in range(n - 1, -1, -1):
        v = [disc * (p * v[j + 1] + (1 - p) * v[j]) for j in range(i + 1)]
        if american:
            v = [max(v[j], pay(S * u ** j * d ** (i - j))) for j in range(i + 1)]
    return v[0]

if __name__ == "__main__":
    S, K, T, r, sig = 100.0, 100.0, 30 / 365, 0.03, 0.20
    c, p = bsm(S, K, T, r, sig), bsm(S, K, T, r, sig, kind="put")
    print(f"S = K = 100, 30 days, r = 3 %, sigma = 20 %: call {c:.4f}, put {p:.4f}")
    print(f"parity C - P = {c - p:.6f};  S - K exp(-rT) = {S - K * math.exp(-r * T):.6f}")
    print(f"with dividend yield q = 2 %: call {bsm(S, K, T, r, sig, 0.02):.4f}")
    print("CRR tree, European put:   n = 10     50     250    1000   (formula)")
    vals = "  ".join(f"{crr(S, K, T, r, sig, n):.4f}" for n in (10, 50, 250, 1000))
    print(f"{'':26s}{vals}  ({p:.4f})")
    for days in (7, 30, 90, 365):
        t = days / 365
        k = S * math.exp(r * t)                    # at-the-money forward strike
        exact = bsm(S, k, t, r, sig)
        approx = S * sig * math.sqrt(t) / math.sqrt(2 * math.pi)
        print(f"ATM-forward call, {days:3d} days: exact {exact:.4f},"
              f" 0.3989*S*sigma*sqrt(T) = {approx:.4f}")
# S = K = 100, 30 days, r = 3 %, sigma = 20 %: call 2.4096, put 2.1633
# parity C - P = 0.246272;  S - K exp(-rT) = 0.246272
# with dividend yield q = 2 %: call 2.3237
# CRR tree, European put:   n = 10     50     250    1000   (formula)
#                           2.1069  2.1519  2.1610  2.1627  (2.1633)
# ATM-forward call,   7 days: exact 1.1049, 0.3989*S*sigma*sqrt(T) = 1.1050
# ATM-forward call,  30 days: exact 2.2872, 0.3989*S*sigma*sqrt(T) = 2.2875
# ATM-forward call,  90 days: exact 3.9604, 0.3989*S*sigma*sqrt(T) = 3.9620
# ATM-forward call, 365 days: exact 7.9656, 0.3989*S*sigma*sqrt(T) = 7.9788

30 天、平值、波动率 20% 时,看涨期权 2.4096,看跌期权 2.1633,二者之差与 S−Ke−rTS – Ke^{-rT} 完全相同,这是平价关系,不依赖于任何波动率假设。加入 2% 的股息率,看涨期权降到 2.3237。二叉树的步数从 10 增加到 1000,看跌期权的价格从 2.1069 逐步逼近公式的 2.1633(1000 步时差 0.0006)。平值远期近似在一周到一个月的期限上几乎精确(30 天时 2.2875 对 2.2872),期限一年时误差升到 0.013。

注

公式的假设,不是市场的事实。 常数波动率、对数正态分布、连续无摩擦交易,这三条在真实市场中都不成立:波动率随时间变化并聚集,收益分布有厚尾,交易有买卖价差且不能连续调整。第二章会看到,市场正是用「不同行权价对应不同的隐含波动率」来修补第一条与第二条;第三章会看到买卖价差在价差交易中有多重要。公式的价值在于它提供了一把公共的尺子:用同一个公式把价格换算成隐含波动率,不同期权才能相互比较 (Hull 2018)。

隐含波动率:反过来解

给定市场价格 CmktC_{\text{mkt}},隐含波动率是使公式价格等于市场价格的 σ\sigma。看涨期权价格对 σ\sigma 单调递增(导数 vega =STφ(d1)>0= S\sqrt{T}\,\varphi(d_1) > 0),所以只要市场价格落在无套利区间 max⁡(S−Ke−rT,0)<C<S\max(S – Ke^{-rT}, 0) < C < S 之内,解就存在且唯一;但它没有解析表达式,必须数值求解。

牛顿法每一步用 σk+1=σk−[C(σk)−Cmkt]/vega(σk)\sigma_{k+1} = \sigma_k – [C(\sigma_k) – C_{\text{mkt}}]/\text{vega}(\sigma_k)。它在解附近二次收敛,几步就到,但初值不好时可能失败:深度虚值、临近到期的期权在远离解的地方 vega 几乎为零,一步就会跳出合理范围。

马纳斯特与克勒的初值。 1982 年,马纳斯特与克勒指出,价格作为 σ\sigma 的函数有唯一的拐点 σc=2|ln⁡(S/K)+rT|/T\sigma_c = \sqrt{2\,|\ln(S/K) + rT|\,/\,T};从这一点出发,牛顿法保证单调收敛到解 (Manaster and Koehler 1982)。这里要说明两点:第一,这是一个初值,不是近似公式;第二,在平值远期处 σc=0\sigma_c = 0,落在 σ>0\sigma > 0 的边界上,d1d_1 在这一点无定义,只能取极限(或改用很小的正初值)。

布伦纳与苏布拉马尼亚姆的近似。 1988 年,布伦纳与苏布拉马尼亚姆把 N(x)N(x) 在 0 附近展开到一次项,得到平值远期期权的近似 C≈SσT/2πC \approx S\sigma\sqrt{T}/\sqrt{2\pi},于是

σ≈2πTCS,\sigma \approx \sqrt{\frac{2\pi}{T}}\,\frac{C}{S},

适用条件是 S=Ke−rTS = Ke^{-rT} (Brenner and Subrahmanyam 1988)。框架中的写法与原文一致,但适用条件必须写明。科拉多与米勒 1996 年给出了对非平值期权更准确的二次近似 (Corrado and Miller 1996)。

二分法兜底。 在区间 [10−4,10][10^{-4}, 10] 上反复折半,每步把误差减半,一定收敛,代价是需要更多步。实务中常见的做法是:先用近似或马纳斯特—克勒初值做牛顿迭代,失败(离开合理区间或 vega 太小)时改用二分法。

下面的程序在 308 个算例上检验这几种方法(11 个行权价 × 7 个期限 × 4 个真实波动率)。时间价值小于 10−610^{-6} 的算例无法可靠反解(价格几乎就是内在价值),先剔除。

推导

# Implied volatility by Newton-Raphson from two starting values (a naive 0.30, and the
# Manaster-Koehler point sigma_c, where the price is an inflection in sigma), with a
# bisection fallback; then the Brenner-Subrahmanyam and Corrado-Miller shortcuts.
import math

def ncdf(x):
    return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))

def call(S, K, T, r, s):
    d1 = (math.log(S / K) + (r + 0.5 * s * s) * T) / (s * math.sqrt(T))
    return S * ncdf(d1) - K * math.exp(-r * T) * ncdf(d1 - s * math.sqrt(T))

def vega(S, K, T, r, s):
    d1 = (math.log(S / K) + (r + 0.5 * s * s) * T) / (s * math.sqrt(T))
    return S * math.sqrt(T) * math.exp(-0.5 * d1 * d1) / math.sqrt(2 * math.pi)

def newton(C, S, K, T, r, s0, tol=1e-8, it=50):
    s = s0
    for k in range(1, it + 1):
        if not 1e-4 < s < 10:
            return None, k                       # left the admissible range
        v = vega(S, K, T, r, s)
        if v < 1e-12:
            return None, k                       # flat price curve: step undefined
        step = (call(S, K, T, r, s) - C) / v
        s -= step
        if abs(step) < tol:
            return s, k
    return None, it

def bisect(C, S, K, T, r, lo=1e-4, hi=10.0, tol=1e-8):
    k = 0
    while hi - lo > tol:
        k += 1; mid = 0.5 * (lo + hi)
        lo, hi = (mid, hi) if call(S, K, T, r, mid) < C else (lo, mid)
    return 0.5 * (lo + hi), k

def sigma_c(S, K, T, r):
    return math.sqrt(abs(2 * (math.log(S / K) + r * T) / T))

if __name__ == "__main__":
    S, r = 100.0, 0.03
    cases = [(K, d / 365, s) for K in (60, 70, 80, 90, 95, 100, 105, 110, 120, 140, 160)
             for d in (3, 7, 14, 30, 60, 120, 365) for s in (0.10, 0.20, 0.40, 0.80)]
    stats = {"naive": [0, 0, 0], "MK": [0, 0, 0]}
    worst, bis_it, skipped, ex = 0.0, [], 0, None
    for K, T, s in cases:
        C = call(S, K, T, r, s)
        if C - max(S - K * math.exp(-r * T), 0) < 1e-6:
            skipped += 1; continue                # no time value left to invert
        for name, s0 in (("naive", 0.30), ("MK", sigma_c(S, K, T, r))):
            est, k = newton(C, S, K, T, r, s0)
            if est is None or abs(est - s) > 1e-6:
                stats[name][1] += 1
                if name == "naive" and ex is None and K > 100:
                    ex = (K, round(T * 365), s, C)
                est, kb = bisect(C, S, K, T, r); bis_it.append(kb)
            else:
                stats[name][0] += 1; stats[name][2] += k
            worst = max(worst, abs(est - s))
    n = len(cases) - skipped
    print(f"{n} invertible cases ({skipped} with no time value skipped)")
    for name, (ok, fail, its) in stats.items():
        print(f"  Newton from {name:5s}: converged {ok:3d}, failed {fail:3d},"
              f" mean iterations {its / max(ok, 1):.1f}")
    print(f"  bisection fallback: {len(bis_it)} calls, {max(bis_it)} iterations each;"
          f" largest error {worst:.1e}")
    K, d, s, C = ex
    print(f"  e.g. K = {K}, {d} days, sigma {s}: price {C:.3f}, vega at 0.30 ="
          f" {vega(S, K, d / 365, r, 0.30):.4f}: overshoot")
    k_atm = S * math.exp(r * 30 / 365); T = 30 / 365
    C = call(S, k_atm, T, r, 0.20)
    print(f"ATM-forward, 30 days: sigma_c = {sigma_c(S, k_atm, T, r):.1e};"
          f" one Newton step from 0 gives {C / (S * math.sqrt(T / (2 * math.pi))):.4f}")
    print("shortcuts, 30 days, true sigma 0.20:  K     B-S 1988   Corrado-Miller")
    for K in (90, 95, 100, k_atm, 105, 110):
        C = call(S, K, T, r, 0.20); X = K * math.exp(-r * T)
        bs = math.sqrt(2 * math.pi / T) * C / S
        a = C - 0.5 * (S - X)
        cm = math.sqrt(2 * math.pi) / (S + X) * (a + math.sqrt(max(a * a - (S - X) ** 2
                                                                     / math.pi, 0)))
        print(f"{'':38s}{K:6.2f}  {bs:.4f}     {cm / math.sqrt(T):.4f}")
# 226 invertible cases (82 with no time value skipped)
#   Newton from naive: converged 193, failed  33, mean iterations 5.7
#   Newton from MK   : converged 226, failed   0, mean iterations 6.7
#   bisection fallback: 33 calls, 30 iterations each; largest error 4.1e-09
#   e.g. K = 110, 3 days, sigma 0.8: price 0.338, vega at 0.30 = 0.0084: overshoot
# ATM-forward, 30 days: sigma_c = 3.8e-08; one Newton step from 0 gives 0.2000
# shortcuts, 30 days, true sigma 0.20:  K     B-S 1988   Corrado-Miller
#                                        90.00  0.8992     0.2384
#                                        95.00  0.5033     0.1889
#                                       100.00  0.2107     0.2000
#                                       100.25  0.2000     0.2000
#                                       105.00  0.0608     0.1949
#                                       110.00  0.0117     0.2084

在 226 个可以反解的算例中,从马纳斯特—克勒初值出发的牛顿法全部收敛,平均 6.7 步;从固定的 0.30 出发,有 33 个失败,例如行权价 110、剩余 3 天、真实波动率 0.8 的看涨期权:在 σ=0.30\sigma = 0.30 处 vega 只有 0.0084,第一步就跨出了合理区间。失败的算例全部由二分法兜底(每次 30 步),所有算例的最大误差为 4×10−94 \times 10^{-9}。

平值远期处 σc\sigma_c 几乎为零(3.8×10−83.8 \times 10^{-8}),但从 0 出发的第一步牛顿迭代恰好就是布伦纳—苏布拉马尼亚姆公式,结果为 0.2000,与真值相同。这说明了这个近似的来历,也说明了它的局限:行权价 95 与 105 时,近似值分别为 0.503 与 0.061,真值都是 0.20;科拉多—米勒公式在这两处为 0.189 与 0.195,好得多,但行权价偏离 10% 时误差仍有 0.008(行权价 110)到 0.038(行权价 90)。所以近似式只适合用作初值或快速检查,不能代替数值反解。

证据

隐含波动率不是对未来波动率的无偏预测。 第二章会看到,标普 500 等指数期权的隐含方差长期平均高于事后实现的方差,这一差额就是方差风险溢价 (Carr and Wu 2009; Bollerslev et al. 2009)。所以「隐含波动率」首先是一种报价单位:它把价格换算成一个可比较的数,而不是市场对未来波动率的最佳估计。

本章小结

布莱克—斯科尔斯—默顿公式在常数波动率、对数正态、连续无摩擦交易的假设下给出欧式期权价格,标准库用 math.erf 即可实现;二叉树随步数增加收敛到公式。隐含波动率是唯一存在但没有解析式的反函数:牛顿法从马纳斯特—克勒初值出发在全部算例上收敛,从固定初值出发约 15% 失败,二分法可以兜底。布伦纳—苏布拉马尼亚姆近似只对平值远期期权成立,它就是从零出发的第一步牛顿迭代。下一章看市场怎样用不同的隐含波动率给不同行权价定价。

参考文献

Black, Fischer, and Myron Scholes. 1973. “The Pricing of Options and Corporate Liabilities.” Journal of Political Economy 81 (3): 637–54. https://doi.org/10.1086/260062.
Bollerslev, Tim, George Tauchen, and Hao Zhou. 2009. “Expected Stock Returns and Variance Risk Premia.” The Review of Financial Studies 22 (11): 4463–92. https://doi.org/10.1093/rfs/hhp008.
Brenner, Menachem, and Marti G. Subrahmanyam. 1988. “A Simple Formula to Compute the Implied Standard Deviation.” Financial Analysts Journal 44 (5): 80–83. https://doi.org/10.2469/faj.v44.n5.80.
Carr, Peter, and Liuren Wu. 2009. “Variance Risk Premiums.” The Review of Financial Studies 22 (3): 1311–41. https://doi.org/10.1093/rfs/hhn038.
Corrado, Charles J., and Jr. Miller Thomas W. 1996. “A Note on a Simple, Accurate Formula to Compute Implied Standard Deviations.” Journal of Banking & Finance 20 (3): 595–603. https://doi.org/10.1016/0378-4266(95)00014-3.
Cox, John C., Stephen A. Ross, and Mark Rubinstein. 1979. “Option Pricing: A Simplified Approach.” Journal of Financial Economics 7 (3): 229–63. https://doi.org/10.1016/0304-405X(79)90015-1.
Hull, John C. 2018. Options, Futures, and Other Derivatives. 10th ed. Pearson.
Manaster, Steven, and Gary Koehler. 1982. “The Calculation of Implied Variances from the Black–Scholes Model: A Note.” The Journal of Finance 37 (1): 227–30. https://doi.org/10.1111/j.1540-6261.1982.tb01105.x.
Merton, Robert C. 1973. “Theory of Rational Option Pricing.” The Bell Journal of Economics and Management Science 4 (1): 141–83. https://doi.org/10.2307/3003143.

Fan, Y. (2026). Implied Volatility Surfaces, Skew Premia and Quantitative Risk Control of Vertical Spreads: Microstructure Pricing and Time-Stop Dynamics under Non-Gaussian Tails [期权隐含波动率曲面、偏度溢价与垂直价差结构的定量风控] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23796765 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).