forecast-sector-relative-return-from-yield-spread
用美債殖利率曲線利差(如 2Y-10Y)建立「領先關係」,推估未來一段時間內成長股(Nasdaq 100)相對防禦股(Healthcare/XLV)的相對績效方向與幅度。
npx skills add majiayu000/claude-skill-registry --skill forecast-sector-relative-return-from-yield-spread --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
<essential_principles> <principle name="lead_lag_definition"> **領先落後關係定義** 殖利率利差(Yield Spread)作為領先指標: ``` spread_t = short_yield_t - long_yield_t = US02Y_t - US10Y_t ``` **spread 越高**:短端相對更高(曲線更倒掛/更緊) **spread 越低**(或從負回到 0、轉正):曲線「回正/變陡」 此 spread 被認為領先反映: - 經濟週期預期(倒掛 → 衰退預期) - 風險偏好轉換(曲線變陡 → 風險偏好回升) </principle> <principle name="relative_return_definition"> **相對報酬定義** 相對強弱比率(Ratio): ``` ratio_t = risk_asset_t / defensive_asset_t = QQQ_t / XLV_t ``` **ratio 上升**:成長股(Nasdaq)相對更強 **ratio 下降**:防禦股(Healthcare)相對更強(XLV 跑贏) 預測目標為「未來 H 個月的對數相對報酬」: ``` future_rel_return = log(ratio(t+H) / ratio(t)) ``` 正值 → Nasdaq 跑贏,負值 → XLV 跑贏 </principle> <principle name="advance_alignment"> **「2 Years in Advance」的真正含義** 圖表的時間對齊邏輯: - 把 spread 往前平移 lead_months 個月 - 目標是檢查:**spread(t) 是否能解釋 ratio(t + H)** 工程化寫法: ``` X = spread(t) Y = future_rel_return(t, H) = log(ratio(t+H) / ratio(t)) ``` 然後做相關性/迴歸/交叉相關掃描來找「最佳領先期」。 **避免直接用 ratio 水平做迴歸**(有趨勢/非平穩問題),改用對數報酬。 </principle> <principle name="validation_framework"> **領先關係驗證框架** 需回答三件事: 1. **是否真的存在穩定領先關係?** - 掃描多個 lead(6, 12, 18, 24, 30 個月) - 看哪個 lead 下 corr(spread, future_rel_return) 最穩、顯著 - 跨子樣本驗證(前半段 vs 後半段) 2. **目前情境對應的預測方向** - 最近 spread 水準、變化率 - 模型預測 E[future_re
cd skills/forecast-sector-relative-return-from-yield-spread pip install pandas numpy yfinance matplotlib statsmodels requests # 首次使用 python scripts/spread_forecaster.py --quick python scripts/spread_forecaster.py \ python scripts/spread_plotter.py --quick --output-dir ../../output
What does the forecast-sector-relative-return-from-yield-spread skill do?
用美債殖利率曲線利差(如 2Y-10Y)建立「領先關係」,推估未來一段時間內成長股(Nasdaq 100)相對防禦股(Healthcare/XLV)的相對績效方向與幅度。
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill forecast-sector-relative-return-from-yield-spread --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
