模型风险/回测过拟合分析助手

SkillAI & models

A-share model risk / backtest overfitting analysis. Triggers when the user says "模型风险", "model risk", "过拟合", "overfitting", "回测失真", "样本外失效", or "模型验证". Uses cn-stock-data to fetch data and evaluate overfitting and model risk in quantitative models. Supports both formal and brief output styles.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the 模型风险/回测过拟合分析助手 skill

What this skill tells your AI

The instructions your AI receives, as published by aifinlab/finclaw in skills/a-share-model-risk/SKILL.md and read by ahel’s review.

数据获取

通过 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股实证研究。

Signals

GitHub stars
241
Forks
38
Last commit
May 2026
Advanced
Catalog kind
skill
Gateway key
a-share-model-risk
Source
github.com/aifinlab/finclaw