5D Library › 宏观流动性体制转换、极值尾部相依与杠铃资产配置 · English

第四章 危机中的相关性与藤 Copula

「危机时相关性趋近 1」

作者的框架中有一句常见的说法:危机来临时,资产之间的相关性趋近 1,分散化失效。这句话包含一个真实的现象,也包含一个统计陷阱。本章先把两方面的证据并列,再讨论如何在多项资产之间描述不对称的尾部相依:藤 Copula。

陷阱:以高波动为条件的相关系数

设两个市场的收益满足 y=βx+ey = \beta x + e,ee 与 xx 独立。相关系数 ρ=βσx/β2σx2+σe2\rho = \beta\sigma_x / \sqrt{\beta^2\sigma_x^2 + \sigma_e^2}。如果危机期间只有 xx 的方差变大为原来的 1+δ1 + \delta 倍,而传导系数 β\beta 与 yy 自身的噪声不变,危机期的相关系数就会机械地升高:

ρc=ρ1+δ1+δρ2,反过来ρ=ρc1+δ(1−ρc2).\rho_c = \rho\sqrt{\frac{1+\delta}{1+\delta\rho^2}}, \qquad\text{反过来}\qquad \rho = \frac{\rho_c}{\sqrt{1+\delta(1-\rho_c^2)}}.

市场之间的联系一点没变,测得的相关却升高了。

证据

福布斯与里戈本指出,以危机期为条件的相关系数因异方差而向上偏,并给出上面的调整 (Forbes and Rigobon 2002)。他们检验了 1997 年东亚危机、1994 年墨西哥比索危机与 1987 年美国股灾:用未调整的相关系数,在若干国家发现了「传染」;用调整后的相关系数,则「几乎没有传染」。他们的结论是:这些时期市场之间的高度联动是平时就存在的强联系的延续,即「没有传染,只有相互依存」。柯塞蒂、佩里科利与斯巴拉恰指出,这一调整依赖特定的模型假设(尤其是关于各市场自身冲击方差的假设),放宽假设后结论可能变为「部分传染、部分相互依存」 (Corsetti et al. 2005)。

下面程序的第一部分模拟三个「世界」,每次比较 500 个平静日与 60 个危机日的相关系数,重复 2,000 次,并用费希尔 z 检验(单侧 5%)判断危机期相关是否显著升高。(1)相互依存:β=0.4\beta = 0.4 不变,危机期 xx 的标准差翻倍(δ=3\delta = 3)。(2)传染:危机期 β\beta 从 0.4 升到 0.8。(3)共同因子:xx、yy 都由一个共同因子驱动,危机期共同因子的方差变为 7 倍,两国各自的冲击不变。

推导

# (1) Forbes & Rigobon (2002): conditioning on a high-volatility period raises measured
# correlation even when the link between markets is unchanged. y = beta*x + e; in a
# 60-day "crisis" the variance of x is 4 times higher (delta = 3). Adjusted correlation:
# rho* = rho_c / sqrt(1 + delta (1 - rho_c^2)). Three SIMULATED worlds, 2,000 crises each.
# (2) Longin & Solnik (2001): exceedance correlation corr(x, y | both beyond theta sd) for
# a bivariate normal, a two-regime variance mixture and a Clayton copula (normal margins).
import math, random, statistics

def corr(a, b):
    ma, mb = statistics.fmean(a), statistics.fmean(b)
    sab = sum((x - ma) * (y - mb) for x, y in zip(a, b))
    return sab / math.sqrt(sum((x - ma) ** 2 for x in a) * sum((y - mb) ** 2 for y in b))

def world(kind, n, crisis, rng):
    xs, ys = [], []
    for _ in range(n):
        if kind == "common factor":          # x = f + u, y = f + e; crisis: var(f) x 7
            f = rng.gauss(0, math.sqrt(7) if crisis else 1)
            xs.append(f + rng.gauss(0, math.sqrt(1.5))); ys.append(f + rng.gauss(0, 2))
            continue
        x = rng.gauss(0, 2 if crisis else 1)
        beta = 0.8 if (kind == "contagion" and crisis) else 0.4
        xs.append(x); ys.append(beta * x + rng.gauss(0, math.sqrt(0.84)))
    return xs, ys

def fisher_z_greater(r1, n1, r0, n0):
    z = (math.atanh(r1) - math.atanh(r0)) / math.sqrt(1 / (n1 - 3) + 1 / (n0 - 3))
    return z > 1.645

if __name__ == "__main__":
    rng = random.Random(2002)
    print("world              calm rho  crisis rho  adjusted   'contagion' found by test")
    print("                                                      raw rho   adjusted rho")
    for kind in ("interdependence", "contagion", "common factor"):
        rc, ra, raw_hit, adj_hit, r0s = [], [], 0, 0, []
        for _ in range(2000):
            x0, y0 = world(kind, 500, False, rng); x1, y1 = world(kind, 60, True, rng)
            r0, r1 = corr(x0, y0), corr(x1, y1)
            delta = statistics.pvariance(x1) / statistics.pvariance(x0) - 1
            adj = r1 / math.sqrt(1 + delta * (1 - r1 * r1))
            r0s.append(r0); rc.append(r1); ra.append(adj)
            raw_hit += fisher_z_greater(r1, 60, r0, 500)
            adj_hit += fisher_z_greater(adj, 60, r0, 500)
        print(f"{kind:18s}  {statistics.mean(r0s):6.3f}    {statistics.mean(rc):6.3f}"
              f"     {statistics.mean(ra):6.3f}      {raw_hit / 2000:5.1%}"
              f"    {adj_hit / 2000:5.1%}")
    print("exceedance correlation: corr of (x, y) on days when both are beyond theta sd")
    N = 400_000; nd = statistics.NormalDist(); models = {}
    pts = []
    for _ in range(N):
        a = rng.gauss(0, 1); pts.append((a, 0.5 * a + math.sqrt(0.75) * rng.gauss(0, 1)))
    models["normal (rho 0.5)"] = pts
    pts = []
    for _ in range(N):
        s = 2.0 if rng.random() < 0.2 else 0.75
        a = rng.gauss(0, 1); b = 0.5 * a + math.sqrt(0.75) * rng.gauss(0, 1)
        pts.append((s * a, s * b))
    models["variance mixture"] = pts
    pts = []
    for _ in range(N):
        v = rng.gammavariate(1 / 1.0, 1)          # Clayton theta 1 (same Kendall tau 1/3)
        u1, u2 = ((1 + rng.expovariate(1) / v) ** -1.0 for _ in range(2))
        pts.append((nd.inv_cdf(u1), nd.inv_cdf(u2)))
    models["Clayton, normal margins"] = pts
    th = (0.0, 0.5, 1.0, 1.5, 2.0)
    print("model                      side  theta = " + "".join(f"{t:6.1f}" for t in th))
    for name, pts in models.items():
        sd = statistics.pstdev([p[0] for p in pts])
        for side, sg in (("down", -1), ("up", 1)):
            row = ""
            for t in th:
                sel = [(x, y) for x, y in pts if sg * x > t * sd and sg * y > t * sd]
                row += f"{corr([p[0] for p in sel], [p[1] for p in sel]):6.2f}"
            print(f"{name:26s} {side:4s}{'':10s}{row}")
# world              calm rho  crisis rho  adjusted   'contagion' found by test
#                                                       raw rho   adjusted rho
# interdependence      0.399     0.655      0.407      85.4%     0.5%
# contagion            0.399     0.866      0.664      100.0%    96.1%
# common factor        0.282     0.720      0.502      99.7%    63.3%
# exceedance correlation: corr of (x, y) on days when both are beyond theta sd
# model                      side  theta =    0.0   0.5   1.0   1.5   2.0
# normal (rho 0.5)           down            0.27  0.22  0.18  0.12  0.13
# normal (rho 0.5)           up              0.27  0.22  0.18  0.15  0.12
# variance mixture           down            0.48  0.48  0.41  0.27  0.23
# variance mixture           up              0.48  0.47  0.39  0.24  0.18
# Clayton, normal margins    down            0.57  0.58  0.58  0.60  0.61
# Clayton, normal margins    up              0.06  0.02 -0.00 -0.01 -0.01

在「相互依存」的世界里,危机期的平均相关系数从 0.399 升到 0.655,未调整的检验在 85.4% 的模拟中宣布「传染」;调整后的相关系数为 0.407,几乎回到平时的水平,误报率只有 0.5%。在真正「传染」的世界里,调整后的相关仍从 0.399 升到 0.664,检验在 96.1% 的模拟中正确发现。到了「共同因子」的世界,问题出现了:两国之间的传导机制并没有改变,只是共同冲击变大了,调整后的检验却在 63.3% 的模拟中宣布「传染」,因为福布斯—里戈本的调整假定危机源自 xx 一个市场。共同冲击变大算不算「传染」,本身就是一个定义问题;这正是检验结论依赖模型的原因。

真实的现象:极端下跌时的相依更强

证据

朗金与索尔尼克用极值理论对 1959 年至 1996 年五个最大股票市场的月度收益建模,研究「超越相关」(两个市场的收益都超过某个阈值时的相关)。他们发现大幅负收益之间的相关远高于多元正态假设所预期的水平,而大幅正收益之间的相关与正态假设并无矛盾;他们也提醒,以高波动为条件的相关即使在真实相关不变时也会上升,解释时要小心 (Longin and Solnik 2001)。昂与陈对美国股票组合也发现,下跌市场中组合与市场的相关明显高于正态模型的预期,上涨市场中则不然 (Ang and Chen 2002)。

程序的第二部分说明为什么「不对称」才是关键证据。对相关系数 0.5 的二元正态分布,超越相关随阈值升高而下降:两边都超过 0 时为 0.27,都超过 2 个标准差时只有 0.12 到 0.13,上下两尾对称。这是正态分布的数学性质(第三章的渐近独立)。两体制的方差混合(20% 的日子波动率是平时的 2.7 倍,两体制相关系数相同)使超越相关整体升高(阈值 0 时为 0.48),但仍然对称并随阈值下降。只有克莱顿 Copula(与正态边际)给出不对称的模式:下尾的超越相关在所有阈值上都约为 0.57 到 0.61,上尾则接近零。

所以朗金与索尔尼克的发现之所以有分量,是因为正态模型预测的是相反的方向:越极端,相关越低。两方的证据可以这样并列:以波动为条件的相关升高,很大一部分是统计上的机械效应,不能直接当作「传染」的证据(福布斯与里戈本);但在极端负收益上,历史数据中的相依确实强于正态模型,而且不对称(朗金与索尔尼克)。两者都没有说相关系数「趋近 1」,所以本书不把它写成定律。

藤 Copula:用二元积木搭出高维相依

第三章的四种 Copula 在高维时都不够灵活:高斯与 t Copula 只能用一个相关矩阵(t 再加一个自由度)描述全部相依,所有资产对的尾部行为由同一个结构决定;阿基米德型 Copula(克莱顿、古贝尔)在高维时通常只有一个参数,所有资产对的相依都一样。藤 Copula 的思路是把 dd 维密度分解为 d(d−1)/2d(d-1)/2 个二元 Copula(「对 Copula」)的乘积,每一对可以选择不同的族与参数。

证据

贝德福德与库克提出用一组嵌套的树(「藤」)来组织这种分解 (Bedford and Cooke 2002);阿斯、恰多、弗里杰西与巴肯给出了两种常用结构 C 藤与 D 藤的对 Copula 构造、极大似然估计与模拟算法,并用于金融收益 (Aas et al. 2009)。

以三维为例:

f(x1,x2,x3)=∏i=13fi(xi)⋅c12(u1,u2)c23(u2,u3)⋅c13|2(F(x1∣x2),F(x3∣x2)),f(x_1,x_2,x_3) = \prod_{i=1}^{3} f_i(x_i)\cdot c_{12}(u_1,u_2)\, c_{23}(u_2,u_3)\cdot c_{13|2}\big(F(x_1\mid x_2),\, F(x_3\mid x_2)\big),

其中 ui=Fi(xi)u_i = F_i(x_i),条件分布由「h 函数」给出:F(x1∣x2)=h(u1∣u2)=∂C12(u1,u2)/∂u2F(x_1 \mid x_2) = h(u_1 \mid u_2) = \partial C_{12}(u_1, u_2)/\partial u_2。第一棵树把相邻的变量两两连接,第二棵树在给定中间变量的条件下连接隔一个的变量,依此类推。D 藤的每棵树都是一条链(1–2–3–4),适合有自然顺序的变量;C 藤的每棵树都是一个星形,以一个「中心」变量(例如市场指数)为根,适合有主导因子的情形。通常还假定条件 Copula 的参数不随条件变量的取值而变(「简化假设」),这是为了可估计性而做的建模选择。

下面的程序构造一个四项资产的 D 藤:第一棵树的三对相邻资产都用克莱顿 Copula(θ=1.5\theta = 1.5,肯德尔 τ = 0.429,下尾相依 2−1/1.5=0.632^{-1/1.5} = 0.63),第二棵树用相关系数 0.3 的高斯 Copula,第三棵树取条件独立。然后用模拟得到的六个两两肯德尔 τ 构造一个高斯 Copula(ρij=sin⁡(πτij/2)\rho_{ij} = \sin(\pi\tau_{ij}/2)),使两个模型的两两秩相关完全相同,比较联合尾部事件与组合风险(边际为自由度 4 的学生 t,标准差 1,等权组合)。

推导

# A four-asset D-vine (order 1-2-3-4) built from pair copulas (Aas et al. 2009):
# tree 1: Clayton theta 1.5 for (1,2), (2,3), (3,4); tree 2: Gaussian rho 0.3 for
# (1,3|2) and (2,4|3); tree 3: independence for (1,4|2,3). ILLUSTRATIVE parameters.
# Compared with a Gaussian copula whose six pairwise Kendall's taus match the vine's.
# Margins: Student t, 4 d.f., scaled to sd 1. 100,000 simulated days per model.
import math, random, statistics

ND = statistics.NormalDist()
TH, RHO = 1.5, 0.3

def h_clayton(u, v, th=TH):                 # h(u|v) = dC(u, v)/dv
    return v ** (-th - 1) * (u ** -th + v ** -th - 1) ** (-1 - 1 / th)

def hinv_clayton(w, v, th=TH):
    return ((w * v ** (th + 1)) ** (-th / (1 + th)) + 1 - v ** -th) ** (-1 / th)

def h_gauss(u, v, r=RHO):
    return ND.cdf((ND.inv_cdf(u) - r * ND.inv_cdf(v)) / math.sqrt(1 - r * r))

def hinv_gauss(w, v, r=RHO):
    return ND.cdf(ND.inv_cdf(w) * math.sqrt(1 - r * r) + r * ND.inv_cdf(v))

def clip(u):
    return min(max(u, 1e-12), 1 - 1e-12)

def dvine(rng):
    w = [clip(rng.random()) for _ in range(4)]
    x1 = w[0]
    x2 = clip(hinv_clayton(w[1], x1))
    f1_2 = h_clayton(x1, x2)                                 # F(x1 | x2)
    x3 = clip(hinv_clayton(clip(hinv_gauss(w[2], f1_2)), x2))
    f2_3, f3_2 = h_clayton(x2, x3), h_clayton(x3, x2)
    f1_23 = clip(h_gauss(f1_2, f3_2))                        # F(x1 | x2, x3)
    a = w[3]                                                 # (1,4|2,3) independent
    f4_3 = clip(hinv_gauss(a, f2_3))                         # F(x4 | x3)
    return x1, x2, x3, clip(hinv_clayton(f4_3, x3))

def kendall(a, b):
    n, s = len(a), 0
    for i in range(n):
        ai, bi = a[i], b[i]
        for j in range(i + 1, n):
            s += 1 if (a[j] - ai) * (b[j] - bi) > 0 else -1
    return 2 * s / (n * (n - 1))

def gauss_copula(rng, R):
    L = [[0.0] * 4 for _ in range(4)]                       # Cholesky factor
    for i in range(4):
        for j in range(i + 1):
            s = R[i][j] - sum(L[i][k] * L[j][k] for k in range(j))
            L[i][j] = math.sqrt(s) if i == j else s / L[j][j]
    z = [rng.gauss(0, 1) for _ in range(4)]
    return tuple(ND.cdf(sum(L[i][k] * z[k] for k in range(i + 1))) for i in range(4))

def t4(u):                                                   # t, 4 d.f., sd 1
    lo, hi = -60.0, 60.0
    for _ in range(60):
        m = (lo + hi) / 2; q = m / math.sqrt(m * m + 4)
        lo, hi = (m, hi) if 0.5 + 0.75 * (q - q ** 3 / 3) < u else (lo, m)
    return lo / math.sqrt(2)

def report(name, us):
    n = len(us)
    for q in (0.05, 0.01):
        both = sum(1 for u in us if u[0] < q and u[3] < q) / n
        allf = sum(1 for u in us if max(u) < q) / n
        print(f"   {name:9s} all four below their {q:.0%} quantile: {allf:.5f}"
              f"   assets 1 and 4 both: {both:.5f}")
    loss = sorted(-sum(t4(v) for v in u) / 4 for u in us)
    k = int(0.99 * n); var = loss[k]; es = statistics.fmean(loss[k:])
    print(f"   {name:9s} equal-weight portfolio (t4 margins): 99 % VaR {var:.2f},"
          f" ES {es:.2f}")

if __name__ == "__main__":
    rng = random.Random(2009)
    V = [dvine(rng) for _ in range(100_000)]
    sub = V[:1500]; tau = [[1.0] * 4 for _ in range(4)]
    for i in range(4):
        for j in range(i + 1, 4):
            tau[i][j] = tau[j][i] = kendall([u[i] for u in sub], [u[j] for u in sub])
    print("Kendall's tau of the vine (1,500 days); Clayton theta 1.5 implies tau"
          f" {TH / (TH + 2):.3f}")
    for i in range(4):
        print("   " + "".join(f"{tau[i][j]:7.3f}" for j in range(4)))
    R = [[math.sin(math.pi * tau[i][j] / 2) for j in range(4)] for i in range(4)]
    G = [gauss_copula(rng, R) for _ in range(100_000)]
    print("joint tail events, 100,000 days each (independence: 0.05^4 = 0.0000063)")
    report("D-vine", V); report("Gaussian", G)
# Kendall's tau of the vine (1,500 days); Clayton theta 1.5 implies tau 0.429
#      1.000  0.446  0.413  0.327
#      0.446  1.000  0.441  0.412
#      0.413  0.441  1.000  0.414
#      0.327  0.412  0.414  1.000
# joint tail events, 100,000 days each (independence: 0.05^4 = 0.0000063)
#    D-vine    all four below their 5% quantile: 0.01906   assets 1 and 4 both: 0.02407
#    D-vine    all four below their 1% quantile: 0.00387   assets 1 and 4 both: 0.00485
#    D-vine    equal-weight portfolio (t4 margins): 99 % VaR 2.48, ES 3.49
#    Gaussian  all four below their 5% quantile: 0.00455   assets 1 and 4 both: 0.01163
#    Gaussian  all four below their 1% quantile: 0.00039   assets 1 and 4 both: 0.00129
#    Gaussian  equal-weight portfolio (t4 margins): 99 % VaR 2.13, ES 2.80

藤的第一棵树三对的样本 τ 为 0.446、0.441、0.414,与理论值 0.429 一致;隔一个与隔两个的资产对 τ 为 0.41 与 0.33。两个模型的两两秩相关相同,但四项资产同时跌破各自 5% 分位的概率,藤 Copula 为 0.019,高斯 Copula 为 0.0046,约为四倍;同时跌破 1% 分位的概率为 0.0039 对 0.00039,约为十倍。只看相距最远的资产 1 与 4,同时跌破 1% 分位的概率也相差近四倍(0.0049 对 0.0013)。等权组合的 99% VaR 为 2.48 对 2.13,高 16%;99% ES 为 3.49 对 2.80,高 25%。也就是说,两两相关一样,并不意味着风险一样;高斯 Copula 在这组参数下系统地低估了「一起跌」的风险。

注

藤 Copula 不是万能的。 四项资产有 6 个对 Copula,二十项资产就有 190 个,每一个都要选择族与参数,选择本身就带来过拟合的风险;树的结构(哪些变量相邻)也要选择。简化假设可能不成立。最重要的是,用平静时期的数据估计的尾部参数,未必适用于危机时期——这正是第一章的体制问题。藤 Copula 让模型能够表达不对称的尾部相依,但不能保证估计出来的那个是对的。

假说 · 尚未验证

作者的假说(尚未确立): 资产之间的下尾相依(例如藤第一棵树中克莱顿 Copula 的参数)在全球流动性紧张的体制中显著高于宽松体制,而在相同的波动率条件下,这一差异仍然存在(即不只是福布斯—里戈本式的机械效应)。什么样的结果能证明它是错的: 在事先固定的资产、窗口与体制划分规则(只用实时可得的信息)下,控制波动率后两种体制的下尾相依之差的置信区间包含零。

本章小结

「危机时相关性趋近 1」不是定律。以高波动为条件的相关系数会机械地升高,福布斯与里戈本调整后在三次危机中几乎没有发现传染;但调整本身依赖模型,在共同因子的世界里会误报。朗金与索尔尼克发现极端负收益的相关远高于正态模型的预期,而正态模型预测的恰恰是越极端越不相关,所以这种不对称是有分量的证据。藤 Copula 用一组二元 Copula 搭出高维相依,可以为不同资产对选择不同的尾部行为;在两两秩相关完全相同的条件下,一个以克莱顿 Copula 为第一棵树的 D 藤,使四项资产同时跌破 1% 分位的概率比高斯 Copula 高约十倍。

参考文献

Aas, Kjersti, Claudia Czado, Arnoldo Frigessi, and Henrik Bakken. 2009. “Pair-Copula Constructions of Multiple Dependence.” Insurance: Mathematics and Economics 44 (2): 182–98. https://doi.org/10.1016/j.insmatheco.2007.02.001.
Ang, Andrew, and Joseph Chen. 2002. “Asymmetric Correlations of Equity Portfolios.” Journal of Financial Economics 63 (3): 443–94. https://doi.org/10.1016/S0304-405X(02)00068-5.
Bedford, Tim, and Roger M. Cooke. 2002. “Vines—a New Graphical Model for Dependent Random Variables.” The Annals of Statistics 30 (4): 1031–68. https://doi.org/10.1214/aos/1031689016.
Corsetti, Giancarlo, Marcello Pericoli, and Massimo Sbracia. 2005. “‘Some Contagion, Some Interdependence’: More Pitfalls in Tests of Financial Contagion.” Journal of International Money and Finance 24 (8): 1177–99.
Forbes, Kristin J., and Roberto Rigobon. 2002. “No Contagion, Only Interdependence: Measuring Stock Market Comovements.” The Journal of Finance 57 (5): 2223–61. https://doi.org/10.1111/0022-1082.00494.
Longin, François, and Bruno Solnik. 2001. “Extreme Correlation of International Equity Markets.” The Journal of Finance 56 (2): 649–76. https://doi.org/10.1111/0022-1082.00340.

Fan, Y. (2026). Macro-Liquidity Regime Switching, Extreme Tail Dependence and Barbell Asset Allocation: Vine Copulas, Hidden Markov Models and Sovereign Buffer Dynamics [宏观流动性体制转换、极值尾部相依与杠铃资产配置] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23828049 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).