Communitygithub.com

Mr-Nobody-Anonymous/All-skills

建立均值-變異數、Black-Litterman 與風險平價最佳化模型,並支援約束管理與再平衡規則。適用於投資組合最佳化、實作風險平價或應用 Black-Litterman 觀點。

All-skills 是什麼?

此技能專注於投資組合最佳化,整合三種主要框架:均值-變異數 (Markowitz)、Black-Litterman 以及風險平價。使用者可以根據目標與數據條件選擇最適合的方法,例如在擁有可靠的預期報酬估計時使用均值-變異數,或從市場均衡權重出發並融入主觀觀點時採用 Black-Litterman。當目標是平衡風險配置而不依賴報酬預測時,風險平價框架則更為合適。技能還包含完整的約束管理機制(如部位限制、週期曝險、交易量預算)以及多種再平衡規則(日曆型與閾值型),並能進行敏感性分析與壓力測試,確保最終投資組合具備穩健性與可靠性。此技能支援多資產與多因子組合,並要求詳細記錄所有假設與參數,以確保可重現性與稽核性。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Mr-Nobody-Anonymous/All-skills/tree/HEAD/awesome_skills/legal/modeling-portfolio-optimization

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

投資組合最佳化模型建置

建立均值-變異數、Black-Litterman 與風險平價最佳化模型,並支援約束管理與再平衡規則。

使用時機

  • 建構或再平衡多資產或多因子組合,以達成風險/報酬目標
  • 將主觀市場觀點融入均衡權重(透過 Black-Litterman)
  • 在資產類別或因子間實作風險平價或等風險貢獻
  • 評估約束條件(部位限制、行業上限、交易量預算)對效率前緣的影響
  • 在市場體制轉變或尾端風險情境下進行壓力測試

需收集的輸入資料

  • 報酬估計:歷史報酬序列(頻率、回顧期間、資產範圍)或來自獨立阿爾法模型的遠期預期報酬
  • 共變異數/風險模型:樣本共變異數、收縮估計量 (Ledoit-Wolf)、因子風險模型或 DCC-GARCH 規格 — 需記錄選擇原因
  • 基準或均衡參考:Black-Litterman 隱含報酬所需的市場市值權重;若追蹤誤差為約束條件則需基準指數
  • 投資者觀點 (Black-Litterman):絕對或相對觀點、信心水準(tau、omega 矩陣校準)
  • 約束條件:最小/最大部位規模、行業/地區/因子曝險限制、僅做多 vs. 多空、交易量上限、交易成本估計
  • 風險預算 (風險平價):每個資產或因子的目標風險貢獻;邊際風險貢獻容忍度
  • 再平衡規則:日曆型(每月、每季)與閾值型(漂移區間),若適用則考慮稅務部位考量

工作流程

  1. 選擇最佳化框架

    • 均值-變異數 (Markowitz):當擁有可信的預期報酬估計,且目標是鎖定效率前緣上的某個點或最大化夏普比率時使用。
    • Black-Litterman:從均衡(市場市值)權重出發,並融入主觀或模型驅動的觀點時使用。需指定 tau(均衡報酬不確定性的縮放因子),並建構選擇矩陣 (P) 與觀點向量 (Q),搭配以信心水準加權的 omega。
    • 風險平價 / 等風險貢獻:當目標是平衡風險配置而不依賴報酬預測時使用。求解權重,使每個資產對投資組合波動的邊際貢獻相等(或與風險預算成比例)。
  2. 準備輸入資料

    • 清理報酬序列:處理遺漏數據、倖存者偏差、公司事件。說明回顧期間與頻率。
    • 估計共變異數矩陣。對於大型資產範圍(>50 個資產),應用收縮法或因子分解以避免奇異或不穩定的矩陣。若進行正規化,需記錄特徵值下限。
    • 對於 Black-Litterman:推導隱含均衡報酬 (π = δΣw_mkt),然後使用 BL 公式與觀點結合。說明 delta(風險厭惡係數)的推導方式。
  3. 建立並求解

    • 定義目標函數(例如,均值-變異數為最大化 w'μ − (λ/2)w'Σw;風險平價為最小化 Σ(RC_i − RC_target)^2)。
    • 將所有約束條件編碼為線性約束或二階錐約束,以適用於凸優化求解器。
    • 使用二次規劃(均值-變異數)、序列最小平方法(風險平價)或封閉形式的 BL 後驗進行求解。
    • 若求解器無法收斂,則逐步放寬最緊的約束條件,並記錄取捨關係。
  4. 分析輸出結果

    • 報告最佳權重、預期報酬、預期波動率、夏普比率與最大回撤(歷史回測)。
    • 分解風險:按資產、因子與行業的貢獻。找出集中風險。
    • 進行敏感性分析:擾動預期報酬 ±50–100 基點、移動相關係數 ±0.05–0.10、在 0.01–0.10 範圍內變化 tau(BL)。報告權重穩定性。
    • 與基準或當前投資組合比較:主動權重、追蹤誤差、資訊比率。
  5. 定義再平衡協議

    • 指定觸發機制:日曆排程或漂移閾值(例如,當任何權重偏離目標 >2% 時再平衡)。
    • 將交易成本模型(固定 + 比例)納入再平衡決策 — 僅在預期效用增益超過估計往返成本時才再平衡。
    • 對於稅務敏感的帳戶,應用稅務部位最佳化,並注意短期與長期資本利得。 [驗證:依管轄區的稅務部位規則]
  6. 文件化與交付

    • 產出模型規格表:目標、約束條件、求解器、輸入來源、日期區間、關鍵參數。
    • 包含假設登記表,並明確標記所有估計或推斷的輸入項目。
    • 附上回測結果與適當的免責聲明(樣本內 vs. 樣本外、交易成本假設、前瞻偏誤檢查)。

輸出

  • 最佳權重表:資產/因子、目標權重、當前權重、交易方向、部位規模
  • 風險分解:按資產、因子與行業的邊際與百分比風險貢獻
  • 效率前緣圖 (均值-變異數) 或 風險貢獻長條圖 (風險平價)
  • 敏感性矩陣:在擾動輸入(報酬、相關係數、tau)下的權重變化
  • 再平衡規則摘要:觸發類型、成本閾值、預期年化週轉率
  • 模型規格表:完整的參數文件以確保可重現性與稽核性

品質檢查

  • 權重總和為 1.0(或針對多空組合的目標淨曝險),且滿足所有既定約束條件
  • 共變異數矩陣為半正定 — 檢查最小特徵值 > 0(或已應用正規化)
  • Black-Litterman 後驗報酬介於均衡報酬與觀點之間 — 極端傾斜表示 omega 校準有誤
  • 風險平價解在容忍範圍內(例如,±0.5% 的目標)達到風險貢獻 — 若否,標記求解器收斂問題
  • 回測夏普比率相對於資產類別歷史合理 — 傳統資產超過 2.0 的比率需審視是否過度擬合
  • 無單一資產超過集中度限制;行業/因子曝險在政策區間內
  • 交易成本假設對資產類別與交易規模合理 [驗證:特定市場的買賣價差與佣金表]
  • 所有假設、數據來源與參數選擇均已記錄 — 無未經證明的「魔術數字」

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Mr-Nobody-Anonymous/All-skills

Build agency portfolios. TRIGGERS - Use when user needs help with agency-portfolio-builder related tasks.

Mr-Nobody-Anonymous/All-skills

Generate landing pages with AI. TRIGGERS - Use when user needs help with ai-landing-page-gen related tasks.

Mr-Nobody-Anonymous/All-skills

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Mr-Nobody-Anonymous/All-skills

Review investment portfolios with rebalancing recommendations. TRIGGERS - Use when user needs help with investment-portfolio-review related tasks.

Mr-Nobody-Anonymous/All-skills

Create makeup artist portfolio guides. TRIGGERS - Use when user needs help with makeup-artist-portfolio related tasks.

Mr-Nobody-Anonymous/All-skills

Build freelance portfolios with case studies. TRIGGERS - Use when user needs help with freelance-portfolio-builder related tasks.

Mr-Nobody-Anonymous/All-skills

Structures secondary portfolio construction with vintage diversification, strategy mix, and geographic allocation optimization. Use when building secondary portfolios, managing allocation targets, or optimizing portfolio composition.

Mr-Nobody-Anonymous/All-skills

Optimize landing page copy for conversions. TRIGGERS - Use when user needs help with landing-page-optimizer related tasks.

Mr-Nobody-Anonymous/All-skills

Build copywriting portfolios. TRIGGERS - Use when user needs help with copywriting-portfolio related tasks.

Mr-Nobody-Anonymous/All-skills

Design cryptocurrency portfolio strategies. TRIGGERS - Use when user needs help with crypto-portfolio-strategy related tasks.

Mr-Nobody-Anonymous/All-skills

Build UX design portfolios. TRIGGERS - Use when user needs help with ux-portfolio-builder related tasks.

Mr-Nobody-Anonymous/All-skills

Design cloud landing zones. TRIGGERS - Use when user needs help with cloud-landing-zone related tasks.

Mr-Nobody-Anonymous/All-skills

Generate high-converting landing page copy with headlines, benefits, CTAs, and social proof. TRIGGERS - Use when user wants landing page copy, sales page content, or conversion-focused web copy.

Mr-Nobody-Anonymous/All-skills

Design portfolio assessment systems. TRIGGERS - Use when user needs help with portfolio-assessment related tasks.

Mr-Nobody-Anonymous/All-skills

Conducts portfolio performance measurement with benchmark comparison, attribution, and risk-adjusted metrics. Use when measuring portfolio performance, calculating Sharpe/Sortino ratios, or conducting performance attribution.

Mr-Nobody-Anonymous/All-skills

Builds strategic and tactical asset allocation models with risk-return optimization and constraint management. Use when constructing portfolios, optimizing asset allocation, or building model portfolios.

Mr-Nobody-Anonymous/All-skills

Creates client-facing portfolio reports with performance, allocation, commentary, and outlook. Use when producing client reports, preparing quarterly reviews, or creating portfolio summaries.

Mr-Nobody-Anonymous/All-skills

Design investment portfolios. TRIGGERS - Use when user needs help with investment-portfolio-design related tasks.

Mr-Nobody-Anonymous/All-skills

Plan investment portfolios. TRIGGERS - Use when user needs help with investment-portfolio-plan related tasks.

Mr-Nobody-Anonymous/All-skills

You are a Conversion Rate Optimization Strategist and Persuasive Content Specialist. Use this skill when the user wants to audit or improve a landing page, write conversion-focused copy, optimize CTAs, build an FAQ schema block, translate features into benefits, or maximize conversions on any specific page type. Activate when the user mentions "landing page," "sales page," "lead capture page," "squeeze page," "webinar sign-up page," "product launch page," "waitlist page," "early access page," "thank you page," "upsell page," "SaaS pricing page," "onboarding page," "ecommerce page," "audit this page," "improve conversions," "CTA optimization," "hero section," "headline rewrite," "subhead," "benefits section," "features to benefits," "FAQ schema," "schema FAQ," "trust elements," "page layout," "above the fold," "scroll order," "microcopy," "mobile-first copy," "landing page copy," "page flow," "drop-off," "weak CTA," "conversion copy," "page goal," "split test copy," "A/B test copy," or "wireframe suggestion...

相關技能