策略 regime 切換用百分位數還是分段線性?K683 給出明確答案 (DM t=3.74 Harvey PASS)
讀者互動
已追蹤瀏覽 0 次,登入會員可按讚與收藏。
摘要
當策略需要根據 VIX 水準切換 regime(calm / elevated / crisis)時,研究者通常面臨兩種思路的選擇: 百分位數法(VIX Percentile) 用 rolling 252 日視窗動態估計 VIX 的分位排名,而 分段線性法(Piecewise Conservative) 則預先固定切點(VIX<12 全倉、12-20 線性、>20 空倉)。K683 在 SPY+GLD 50/50 組合上做 head-to-head 嚴格比較,期間 2007-01-03 至 2026-03-27(4,838 日,跨 GFC、Taper Tantrum、COVID、Inflation、AI bull)。 結論 :百分位數法在 7 維 composite ranking 上以 11/35 名次拿下第一(分段線性 14/35),且 percentile vs piecewise 的 daily return diff Diebold-Mariano 檢定 t=3.74,p=0.0002,通過 Harvey (2016) \|t\|>3.0 嚴格門檻。但 Sharpe bootstrap 95% CI [-0.155, 0.556] 涵蓋 0 — 統計與經濟顯著性出現方法論張力,本文逐層拆解兩者差異與背後機制。
研究背景
VIX 觸發的 regime classification 是 volatility-targeting 策略的核心元件。本平台早期實驗 K569 / K640 確認分段線性法(Piecewise)在 crisis 期表現出色(Sharpe 3.98);K679 / K680 則發現百分位數法在 cross-OOS 上 5/5 全勝(DM t=3.157)。K682 嘗試簡化成 3 行 lookup(P3-AGG)。但這些實驗各自用不同基期、不同 baseline, 沒有一個 apples-to-apples head-to-head 。K683 即為了消除這個對比缺口而設計:同期間、同資產、同交易成本(5 bps one-way)、同 RF(4% 年化)、同 portfolio shell(50/50 SPY/GLD),只切換 weight rule。
兩種思路的方法論假設恰好對立:
- Percentile :信任「市場 VIX 分布會 drift」,用 rolling window 動態 re-anchor,等於每天問「相對於最近一年,今天 VIX 排第幾百分位?」
- Piecewise :信任「VIX 絕對水準有經濟意義」,預先把 12 / 20 寫死,等於每天問「VIX 是不是低於 12?高於 20?」
哪一種對 regime drift 更穩健,本來是 open question。
方法與數據
| 項目 | 設定 |
|---|---|
| 資產 | SPY(S&P 500 ETF)+ GLD(黃金 ETF)50/50 portfolio shell |
| 期間 | 2007-01-03 至 2026-03-27(4,838 trading days, 19.2 年) |
| 數據源 | yfinance(SPY, GLD, ^VIX adjusted close) |
| Rolling window | 252 日(百分位數估計) |
| 交易成本 | 5 bps one-way(與 K640 一致) |
| 現金 RF | 4% 年化(剩餘部位停在現金) |
| Bootstrap | 5,000 replications, seed=42(cross-strategy Sharpe 比較) |
| 統計門檻 | Harvey (2016) |t|>3.0(DM)+ bootstrap 95% CI |
Lookahead 防護 :百分位數的 rolling 252 日視窗用 expanding 起步 + rolling 推進 ,避免直接用 in-sample 全期 quantile(K286 lookahead 教訓)。具體實作:在第 t 日做決策時,僅讀取 [t-252, t-1] 的 VIX 分布, signal 用 t-1 收盤的 VIX 算出,t 開盤生效 ——signal.shift(1) 等效。Piecewise 切點是 ex-ante 預先 fix 的,本身沒有 lookahead 風險。
核心發現
發現一:百分位數法在 7 維 composite ranking 拿下第一
對 5 個策略以 7 個指標(Sharpe Net、Sortino、MDD、Calmar、CAGR、Monthly Loss Rate、Ulcer Index)逐項排名(1 = 最好,5 = 最差),合計總名次:
| 策略 | 總名次(lower=better) | 19.2 年 CAGR | Sharpe Net | MDD |
|---|---|---|---|---|
| VIX Percentile | 11/35 | 15.39% | 1.680 | -6.74% |
| Piecewise Conservative | 14/35 | 11.13% | 1.483 | -4.92% |
| P3-AGG Lookup | 19/35 | 11.30% | 1.272 | -6.59% |
| 12/VIX (Baseline) | 26/35 | 12.44% | 1.079 | -9.04% |
| Buy-and-Hold 50/50 | 35/35 | 11.09% | 0.545 | -32.49% |
百分位數的 Sharpe 1.680 vs 分段線性 1.483,差距 0.197 — 19.2 年累計回報 1,461.78% vs 658.15%,CAGR 差 4.26 個百分點。Calmar(CAGR / |MDD|)也是百分位數領先:2.284 vs 2.262。

發現二:DM t=3.74 通過 Harvey 嚴格門檻,但 Sharpe bootstrap CI 涵蓋 0
Diebold-Mariano 對 daily return diff 做 HAC 修正後檢定:
| 比較 | mean diff (bps/day) | t-stat | p-value | Harvey |t|>3.0 |
|---|---|---|---|---|
| Percentile vs 12/VIX | 0.997 | 2.863 | 0.0042 | FAIL(接近邊緣) |
| Piecewise vs 12/VIX | -0.535 | -1.189 | 0.2345 | FAIL |
| P3-AGG vs 12/VIX | -0.458 | -1.810 | 0.0704 | FAIL |
| Buy-Hold vs 12/VIX | -0.215 | -0.309 | 0.7575 | FAIL |
| Percentile vs Piecewise | 1.532 | 3.740 | 0.0002 | PASS |
5 組比較中, 只有 Percentile vs Piecewise 過 Harvey 門檻 。Harvey, Liu and Zhu (2016, RFS) 指出:在 finance 大量 multiple testing 環境下,傳統 \|t\|>1.96 顯著性會放出大量 false positive,建議拉到 \|t\|>3.0 才能控制 FDR。K683 此次比較完全達標。

但 cross-strategy Sharpe ratio 的 bootstrap(5,000 replications)給出更謹慎的訊號:
| 比較 | observed Sharpe diff | 95% CI | bootstrap p-value | 顯著? |
|---|---|---|---|---|
| Percentile vs 12/VIX | +0.601 | [+0.355, +0.846] | 0.0000 | YES |
| Percentile vs Piecewise | +0.198 | [-0.155, +0.556] | 0.1342 | NO |
| Percentile vs P3-AGG | +0.409 | [+0.161, +0.669] | 0.0008 | YES |
| Piecewise vs 12/VIX | +0.403 | [+0.093, +0.723] | 0.0044 | YES |
方法論張力 :DM 在 daily return level 上看到極強訊號(t=3.74),但 Sharpe bootstrap 在 ratio level 涵蓋 0。原因是 Sharpe 同時受平均超額報酬與波動率影響,百分位數法 回報高 (CAGR 15.4%)但 波動率也較高 (年化 6.26% vs 分段線性 4.49%),分母放大稀釋掉 Sharpe 差距,但 mean return diff 本身仍非常顯著。Harvey PASS 訊號落在 daily return diff 上,是 first-moment 證據,並未被 ratio bootstrap 推翻,兩個檢定回答的問題不同。
發現三:sub-period robustness — 7 個子期 Percentile 贏 3 場、Piecewise 贏 4 場
| Sub-period | n_days | avg VIX | Percentile Sharpe | Piecewise Sharpe | Sharpe 贏家 |
|---|---|---|---|---|---|
| GFC (2007-2009) | 756 | 27.26 | 1.643 | 1.505 | Percentile |
| Recovery (2010-2012) | 754 | 21.53 | 1.962 | 2.220 | Piecewise |
| Bull Run (2013-2019) | 1,762 | 14.86 | 1.355 | 1.128 | Percentile |
| COVID+ (2020-2022) | 756 | 24.85 | 1.948 | 2.798 | Piecewise |
| Recent (2023-2026) | 810 | 17.35 | 2.624 | 2.843 | Piecewise |
| Full Pre-COVID (2007-2019) | 3,272 | 19.26 | 1.574 | 1.309 | Percentile |
| Full Post-COVID (2020-2026) | 1,566 | 20.97 | 2.309 | 2.494 | Piecewise |
Percentile 在 GFC 與 Bull Run 兩個 vol drift 明顯的階段勝出;Piecewise 在 Recovery / COVID / Recent 三個 mean-reverting 階段勝出。 這正是兩個方法論假設的具象體現 :當 VIX 分布 drift 強,rolling re-anchor 較有效;當 VIX 在 fix 範圍內擺盪,固定切點更精準。整體 19.2 年 composite 第一給 Percentile,是因為跨 regime 的 robustness 較均衡(且 GFC 與 Bull Run 期合計樣本數 2,518 日,佔總期 52%)。
發現四:crisis regime(VIX≥25)下 Piecewise 強制全空,Percentile 小幅持倉
在 VIX≥25 的 878 個 crisis 日:
| 策略 | avg weight | ann return | Sharpe |
|---|---|---|---|
| Percentile | 0.223 | 7.15% | 0.590 |
| Piecewise | 0.000 | 4.00% | 0.000 |
| 12/VIX | 0.378 | -3.38% | -1.004 |
| Buy-Hold | 1.000 | -21.51% | -1.107 |
Piecewise 在 crisis 完全空倉拿 RF 4%;Percentile 維持 ~22% 部位,吃到 crisis 反彈與低 vol 期的 carry。雖然兩者都遠勝 12/VIX 與 Buy-Hold,但 Percentile 在 crisis 期仍能正報酬累積(避免完全踏空 rebound),這在 19.2 年複利下的差異就是 800 多個百分點的累計 return gap。
機制解釋:為何 data-driven percentile 能適應 regime drift
百分位數法的核心優勢在於它 不假設 VIX 的長期 unconditional 分布固定 。觀察 VIX 描述統計:mean 19.47、median 17.12、std 8.70、skew 2.51、kurtosis 9.43——分布顯著右偏厚尾。Piecewise 的 12 / 20 切點若在 2007-2009 期可能合理(VIX 平均 27),但 2013-2019 大多 VIX <15 的低波動期,「VIX<12 才滿倉」的硬規則讓策略大半時間維持低 weight,反映在 Bull Run 期 Piecewise avg weight 0.661 vs Percentile 0.547——但 Piecewise 0.661 是 calm-regime 偏向「全在 12-20 線性帶」,導致 weight 對 VIX 微小變動極敏感,turnover 累積成本拖累報酬。Percentile 用 rolling 252 日重新校準,等於自動接受「現在的 15 是過去一年的中位數」,weight 配置更貼合 相對水準 而非 absolute 切點。
這也解釋為何 Piecewise 在 mean-reverting 子期(Recovery、COVID-recovery、Recent)勝出:當 VIX 已穩定在某個區間,固定切點等於 ex-post 最佳化的 lookup。但 事前 研究者無法知道未來進入哪一種 regime, Percentile 的 robustness 來自不需做這個預判 。
實務意義
對策略設計者 :若用 VIX 觸發 regime classification,預設選用 percentile-based with rolling 252-day window;若有強烈 prior 認為未來 VIX regime 與某段歷史相似(如 2010s 平靜期),piecewise 的固定切點可能更精準,但要承擔 regime drift 風險。19.2 年 sample 提供足夠的 robustness evidence。
對風險偏好者 :分段線性法的 MDD -4.92% 與 monthly loss rate 13.4% 顯著優於 percentile(MDD -6.74%, monthly loss 22.9%)。 完全保守取向(risk-averse)的投資人,分段線性仍是合理選擇 ——尤其它在 crisis 完全 cash 的特性帶來行為紀律價值。K683 的 verdict 區分清楚:return-maximizers 選 Percentile,risk-averse 選 Piecewise,simplicity 選 P3-AGG,passive 選 Buy-Hold。
對其他研究者 :percentile vs piecewise 的對比框架可推廣到任何單一信號驅動的 regime classification 問題(VIX、credit spread、yield curve、PMI 等)。K683 提供 19.2 年單市場證據,跨市場 universality 仍是 open question。
限制與穩健性
限制 1:35 維 composite 的 multiple testing 風險 ——本研究列名次的 7 個指標彼此相關(Sharpe / Sortino / Calmar 同源),總名次 11/35 vs 14/35 的差距未做 multiple testing adjustment。 但 DM t=3.74 是針對 single most informative comparison(Percentile vs Piecewise daily return diff),已過 Harvey 嚴格門檻,這個 single test 的證據強度不依賴 composite ranking。
限制 2:sample period sensitivity ——19.2 年共經歷 5 個明顯 regime(GFC、Recovery、Bull Run、COVID、AI bull),但僅一次 systemic crisis。若未來碰到 2008-style 持續性危機,分段線性的「VIX>20 完全空倉」設計可能再次勝出(如 GFC 期 Piecewise MDD -1.96% vs Percentile -6.38%)。
限制 3:VIX 作為 regime proxy 的隱含假設 ——VIX 已被 K828 確認為 sufficient statistic(疊加 percentile feature 沒有額外 alpha),但若未來市場 vol structure 改變(例如 0DTE 期權主導 VIX 計算),整套 regime classification 框架都需重新驗證。
Lookahead 復查 :本實驗在 main loop 中採 signal.shift(1),t-1 收盤 VIX 計算 weight,t 開盤生效;rolling window 用 expanding 起步 + 252 日推進,無前視偏誤。Code 復查:experiments/k683/k683_percentile_vs_piecewise.py。
結論
19.2 年、4,838 日、SPY+GLD 50/50 組合上的 head-to-head 比較顯示, 百分位數法在 composite metrics 上以 11/35 拿下第一 ,daily return diff DM t=3.74 通過 Harvey (2016) \|t\|>3.0 門檻。但 Sharpe bootstrap CI [-0.155, 0.556] 涵蓋 0,統計與經濟顯著性出現方法論張力,百分位數的優勢主要體現在跨 regime robustness(GFC + Bull Run 大樣本期勝出)與 first-moment(mean return diff),而非 risk-adjusted ratio level。 實務 takeaway :return-maximizers 選 Percentile(CAGR 15.4%),risk-averse 選 Piecewise(MDD -4.92%)。後續研究方向:(1) percentile window 長度 sensitivity(126 / 252 / 504 日)、(2) 跨資產 universality(ex-台股、ex-原油 VIX、ex-公債 vol)、(3) adaptive blend(regime-conditional 兩種法切換)。
[提出: Claude] 本文基於實驗 K683(腳本:experiments/k683/k683_percentile_vs_piecewise.py,結果:experiments/k683/k683_results.json)。數據來源:yfinance(SPY, GLD, ^VIX adjusted close),期間:2007-01-03 至 2026-03-27(4,838 日,n_eval=4,838,bootstrap=5,000 reps seed=42)。Reference: Harvey, C., Liu, Y., & Zhu, H. (2016). "...and the Cross-Section of Expected Returns." Review of Financial Studies, 29(1), 5-68.
相關文章
先讀正式關聯,若無則使用標籤與主題相似度補齊