Portfolio attribution calculation

From aifinlab/FinClaw · View interactive version

Portfolio attribution calculation is an AI agent skill from the GitHub repository aifinlab/FinClaw. 用于收益归因的组合归因计算原子 skill,适用于通用行业金融计算场景。

How to use this skill

Skill file

组合归因计算 Skill

数据来源

本 Skill 支持多种组合数据输入格式,核心数据来源包括:

1. 组合持仓数据

2. 收益率数据

3. 数据格式要求

说明:本 Skill 不包含数据采集功能,需要用户提供清洗后的组合持仓和收益率数据。建议数据时间跨度不少于1年,以便进行准确的归因分析。


功能

本 Skill 提供全面的组合归因分析能力,涵盖多种归因方法:

1. 收益归因分析

2. 风险归因分析

3. 归因指标计算

4. 归因报告生成

5. 数据处理能力


使用示例

输出示例

{
  "portfolio": "组合A",
  "period": "2024-01-01 to 2024-12-31",
  "attribution": {
    "total_return": 15.8,
    "benchmark_return": 12.5,
    "excess_return": 3.3,
    "allocation_effect": 1.2,
    "selection_effect": 1.8,
    "interaction_effect": 0.3
  },
  "industry_attribution": {
    "金融": 0.8,
    "科技": 1.5,
    "消费": 0.6,
    "其他": 0.4
  },
  "style_attribution": {
    "value": 1.2,
    "growth": 1.1,
    "large_cap": 0.7,
    "small_cap": 0.3
  },
  "risk_attribution": {
    "total_risk": 18.5,
    "idiosyncratic_risk": 12.3,
    "systematic_risk": 6.2
  }
}

注意事项与限制

1. 数据质量要求

2. 归因方法选择

3. 时间序列分析

4. 综合判断原则

5. 使用限制


参考资料

License

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.