Communitygithub.com

Mr-Nobody-Anonymous/All-skills

运行蒙特卡洛模拟,用于投资组合分析,包括收益分布、尾部风险和路径依赖场景评估。在需要进行投资组合模拟、估计尾部风险或分析收益分布时使用。

All-skills 是什么?

该技能专为 AI Agent(如 Claude Code、Cursor、Codex 等)设计,用于执行蒙特卡洛投资组合分析。它能够生成多资产投资组合的收益分布、尾部风险指标和路径依赖场景评估。其核心价值在于处理传统解析方法难以解决的复杂场景,例如非正态收益、杠杆约束或动态对冲下的投资组合优化。技能支持多种收益分布模型(正态、Student-t、偏态正态、经验自助法)、相关性结构(静态Pearson、DCC-GARCH、Copula)以及路径依赖规则(再平衡频率、现金流入/流出、回撤触发式降风险等)。工作流程涵盖输入验证、模型校准、模拟路径生成、统计计算和敏感性检验,最终输出包含汇总统计表、分布图表规范、敏感性矩阵和路径依赖分析报告。该技能特别适用于估计收益概率分布、量化尾部风险、评估序列回报风险和压力测试投资组合配置。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Mr-Nobody-Anonymous/All-skills/tree/HEAD/awesome_skills/legal/conducting-monte-carlo-portfolio-analysis

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

进行蒙特卡洛投资组合分析

运行蒙特卡洛模拟进行投资组合分析,生成多资产投资组合的收益分布、尾部风险指标和路径依赖场景评估。

使用时机

  • 在指定时间范围(1个月至30年)内估算投资组合收益的概率分布
  • 量化尾部风险(CVaR/ES、最大回撤分布、左尾概率)
  • 评估路径依赖特征:序列回报风险、现金流叠加、再平衡触发机制或类期权收益
  • 在体制转换或肥尾假设下对投资组合配置进行压力测试
  • 在封闭解析分析不足时(如非正态收益、杠杆约束、动态对冲)比较不同配置候选方案

需要收集的输入

  • 资产类别及权重 — 股票代码或资产类别、目标配置及任何约束条件(最小/最大界限、行业上限)
  • 收益假设 — 历史回看窗口或前瞻性资本市场假设(预期收益、波动率、相关系数矩阵)
  • 分布模型 — 正态、Student-t(指定自由度)、偏态正态或经验自助法 [验证:确认分布选择适合所涉资产类别]
  • 模拟参数 — 路径数量(默认:10,000;对于稳定的尾部估计建议使用50,000以上)、时间步长(每日/每月)、时间范围长度
  • 相关性结构 — 静态Pearson矩阵、DCC-GARCH、Copula设定(高斯型对比Clayton/Gumbel以处理尾部相关性)[验证:与投资组合经理确认Copula选择]
  • 路径依赖规则 — 再平衡频率及幅度、现金流入/流出、回撤触发的降风险操作、税收损失收割逻辑
  • 无风险利率和通胀假设 — 用于实际收益或夏普比率计算
  • 基准(可选) — 用于相对收益分析的指数或负债流

工作流程

  1. 验证输入

    • 确认相关系数矩阵为半正定矩阵;若非则应用最近半正定修正
    • 检查是否存在过时或缺失的收益序列;标记超过5个交易日的缺失
    • 验证权重向量之和为1.0(或预期的杠杆比率)
  2. 校准收益生成模型

    • 将所选分布拟合到每项资产的收益序列(MLE或矩估计)
    • 估计相关系数/Copula参数;报告拟合优度(例如Anderson-Darling p值)
    • 若使用体制转换模型:估计隐马尔可夫模型状态(牛市/熊市/危机)及转移概率 [验证:确认体制数量]
  3. 生成模拟路径

    • 通过Cholesky分解(正态分布)或Copula抽样(非正态分布)生成相关随机变量
    • 为每项资产构建累计收益路径;在每个再平衡步骤应用投资组合权重
    • 执行路径依赖规则:执行再平衡、应用交易成本、叠加现金流
  4. 计算输出统计量

    • 分布指标 — 终期财富或年化收益的均值、中位数、标准差、偏度、峰度
    • 尾部风险指标 — 置信水平95%和99%的VaR和CVaR;最大回撤分布(中位数、第95百分位);超过用户定义阈值的损失概率
    • 路径统计量 — 中位路径、第5/25/75/95百分位扇形图;回撤超过X%后的恢复时间分布
    • 情景分析 — 最差5%路径的条件统计量(危机体制分析)
  5. 敏感性及稳健性检查

    • 在预期收益和波动率的基础上±1个标准误差重新运行,评估输入敏感性
    • 比较不同分布假设(正态 vs. Student-t vs. 自助法)下的结果
    • 确认收敛性:验证关键指标在路径数量加倍后是否趋于稳定
  6. 编写报告

    • 以汇总表格和扇形图可视化规范形式呈现结果
    • 突出关键风险发现:未能达到收益阈值的概率、最差情况回撤以及左尾情景
    • 说明所有假设、模型局限性及数据时效

输出

  • 汇总统计表 — 预期年化收益、波动率、夏普比率、VaR(95/99)、CVaR(95/99)、最大回撤(中位数及第95百分位)、负收益概率、达到目标收益的概率
  • 分布图表规范 — 终期收益直方图(带VaR/CVaR标记);累计财富路径扇形图(5/25/50/75/95百分位区间)
  • 敏感性矩阵 — 在不同收益、波动率和相关系数假设下的关键指标
  • 路径依赖分析 — 再平衡频率、现金流时机以及回撤触发规则对终期财富分布的影响
  • 假设日志 — 分布模型、校准方法、模拟次数、随机种子(用于可重复性)、数据来源及日期

质量检查

  • 模拟次数充足:尾部指标(99% CVaR)在使用不同随机种子重新运行时变化不应超过2%
  • 模拟收益均值接近输入预期收益,差异在±10个基点范围内(生成引擎的合理性检查)
  • 模拟资产收益的相关性与输入矩阵匹配,差异在±0.02以内
  • 路径依赖规则至少通过一个手动追踪场景进行验证
  • 所有[验证]项在交付前已解决或明确标记为待处理
  • 结果不作为预测呈现——需声明输出反映模型假设,而非对未来表现的预测

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...

相关技能