# Factor Research

Factor research framework with IC/IR analysis, quantile backtesting, and factor...

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Writing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill factor-research -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill factor-research -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill factor-research -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill factor-research -g -a gemini-cli -y`

## Description

Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Factor Research Framework

## Purpose

Systematically evaluates the predictive power of single or multiple factors. Uses IC/IR statistical tests and quantile backtests to determine whether a factor has stock-selection power, and to guide factor screening and combination.

Applicable scenarios:
- Single-factor validity testing (momentum, value, quality, volatility, and more)
- Determining weights for multi-factor combination
- Factor decay analysis (IC changes across different holding periods)
- Comparing factor differences across industries and markets

## Workflow

1. **Calculate factor values**: compute factor exposures for each instrument on the cross-section, and output a factor CSV (`index=date`, `columns=codes`)
2. **Calculate returns**: compute each instrument's forward N-day return, and output a return CSV (same structure)
3. **Call the `factor_analysis` tool**: pass in the factor CSV, return CSV, and output directory
4. **Interpret the results**: judge factor validity based on IC/IR criteria and quantile backtest results
5. **Factor screening / combination**: keep effective factors and combine them with equal weights or IC-based weights

**Key point**: the rows (dates) and columns (instrument codes) of the factor CSV and return CSV must align exactly. Returns must be forward returns after the factor-observation date (to avoid look-ahead bias).

## `factor_analysis` Tool Parameters

| Parameter | Type | Required | Default | Description |
|------|------|------|------|------|
| factor_csv | string | Yes | - | Path to the factor-value CSV |
| return_csv | string | Yes | - | Path to the return CSV |
| output_dir | string | Yes | - | Output directory for results |
| n_groups | integer | No | 5 | Number of quantile groups |

## Output Files

| File | Contents |
|------|------|
| ic_series.csv | Daily IC series |
| ic_summary.json | IC mean, IC standard deviation, IR, proportion of IC > 0 |
| group_equity.csv | Cumulative equity curves for each quantile group |

The rest: https://github.com/HKUDS/Vibe-Trading/blob/HEAD/agent/src/skills/factor-research/SKILL.md
