A股模型风险/回测过拟合分析。当用户说"模型风险"、"model risk"、"过拟合"、"overfitting"、"回测失真"、"样本外失效"、"模型验证"时触发。基于 cn-stock-data 获取数据,评估量化模型的过拟合与模型风险。支持 formal/brief 两种输出风格。
Scanned 9/7/2026
Install to Claude Code
npx -y skills add aifinlab/FinClaw --skill a-share-model-risk --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of A Share Model Risk?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/aifinlab-a-share-model-risk)More formats (shields.io, HTML) on the badges page.
---
name: a-share-model-risk
description: A股模型风险/回测过拟合分析。当用户说"模型风险"、"model risk"、"过拟合"、"overfitting"、"回测失真"、"样本外失效"、"模型验证"时触发。基于 cn-stock-data 获取数据,评估量化模型的过拟合与模型风险。支持 formal/brief 两种输出风格。
---
# 模型风险/回测过拟合分析助手
## 数据获取
通过 cn-stock-data skill 获取数据:
- **回测结果**: 策略回测的绩效数据
- **模型参数**: 模型配置与超参数
- **样本外数据**: 未参与训练的数据
## 分析工作流
### Step 1: 过拟合检测
- 训练集vs测试集表现差距:差距>30%疑似过拟合
- 参数敏感性:微调参数后表现大幅变化=过拟合
- 策略复杂度:参数越多过拟合风险越大
- 多重检验:测试了N个策略,需调整显著性水平
### Step 2: 回测陷阱识别
- 前视偏差(look-ahead bias):使用了未来信息
- 幸存者偏差(survivorship bias):只用存活股票
- 数据窥探(data snooping):反复优化直到好看
- 交易成本低估:未考虑滑点/冲击/流动性
### Step 3: 模型验证方法
- 样本外测试:严格的时间外推验证
- Combinatorial Purged CV:Lopez de Prado方法
- Walk-forward分析:滚动窗口前推验证
- 蒙特卡洛排列检验:随机打乱标签的基准
### Step 4: 模型风险管理
- 模型多样化:不依赖单一模型
- 定期重验证:每季度重新评估模型有效性
- 模型衰减监控:IC/Sharpe的滚动趋势
- 模型退役标准:连续N月表现低于阈值则停用
### Step 5: 输出报告
## 输出格式
### formal 风格(研报级)
```
# 模型风险评估报告
## 一、过拟合检测
| 指标 | 训练集 | 测试集 | 差距 |
|------|--------|--------|------|
## 二、回测陷阱
[各类偏差检查结果]
## 三、验证结果
[样本外/CV/排列检验]
## 四、风险管理建议
```
### brief 风格(快速分析)
```
## 模型风险速览
- 训练Sharpe 3.2 vs 测试 1.8,差距44%
- 过拟合风险:中等
- 未发现前视偏差
- 建议:简化模型,减少参数数量
```
参考 `references/model-risk-guide.md` 获取详细方法论与 A股实证研究。
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Create Mermaid diagrams for flowcharts, sequences, ERDs, and
Understand the components, mechanics, and constraints of context in agent systems. Use when designing agent architectures, debugging context-related failures, or optimizing context usage.
Draft release notes and changelog entries from git history or merged PRs between two refs (tags/SHAs/branches), including breaking changes, migrations, and upgrade steps. Use when the user asks for release notes, changelog updates, or a GitHub Release draft.
Documentation style guide enforcer by @planetabhi. Applies and reviews the writing style guide when authoring or editing product documentation and tutorials. Use to check prose for voice, tense, word choice, inclusive language, formatting, code block, UI, Markdown, and number/date conventions.
Quick-reference card for all caveman modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /caveman-help, "caveman help", "what caveman commands", "how do I use caveman".