factor-research
できること
このスキルは、銘柄のグループについて株式ファクターを評価し、どのファクターに実際の予測力があるかを確認します。ファクターをスクリーニングし、良いものを組み合わせたい定量アナリスト向けです。
使う場面
- ✓モメンタムやバリューなどの単一のファクターが、リターンを予測するかを検証したいとき。
- ✓複数のファクターを組み合わせるための重みを決めたいとき。
- ✓異なる保有期間で、ファクターの予測力がどれくらい速く薄れるかを見たいとき。
スキルのリンク
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/factor-research/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このリストの銘柄について、モメンタムとバリューのファクターがリターンを予測するか検証し、組み合わせる価値があるのはどちらか教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、各ファクターの値と、各銘柄の将来のリターンを計算し、ファクター分析のツールを実行して、ICとIRの統計と分位のバックテストを求めます。これらの結果から各ファクターの妥当性を判断し、有効なファクターを組み合わせる方法を提案します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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
- Calculate factor values: compute factor exposures for each instrument on the cross-section, and output a factor CSV (
index=date,columns=codes) - Calculate returns: compute each instrument's forward N-day return, and output a return CSV (same structure)
- Call the
factor_analysistool: pass in the factor CSV, return CSV, and output directory - Interpret the results: judge factor validity based on IC/IR criteria and quantile backtest results
- 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 |
IC/IR Interpretation Standards
| Metric | Threshold | Interpretation |
|---|---|---|
| IC mean | > 0.03 | Factor has basic predictive power |
| IC mean | > 0.05 | Factor has strong predictive power |
| IC mean | > 0.10 | Unusually high; check for look-ahead bias |
| IR (IC mean / IC std) | > 0.5 | Factor is stably effective |
| IR | > 1.0 | Extremely strong, very rare |
| Proportion of IC > 0 | > 55% | Factor direction is stable |
| Proportion of IC > 0 | < 50% | Factor direction is unstable and unusable |
Note: negative IC can also be useful (reverse factors). Judge by absolute value, and reverse the signal direction in actual use.
Quantile Backtest Interpretation
Quantile backtesting sorts instruments into N groups by factor value from low to high (default 5 groups), with equal-weight holding inside each group.
Criteria:
- Monotonicity: the final net values from
Group_1toGroup_Nshould show a monotonic rising (or falling) pattern. Better monotonicity means stronger factor discrimination - Long-short spread: the net-value difference between the highest and lowest group (
long_short_spread). A larger spread means stronger selection power - Nonlinearity: if only the top and bottom groups differ materially while the middle groups are similar, the factor may only be effective in the tails
- Stability: group equity curves should be smooth; sharp swings indicate an unstable factor
Warning signs:
- No meaningful difference across group equity curves → the factor is ineffective
- Non-monotonic pattern (such as V-shape or inverted V-shape) → the factor may have a nonlinear relationship and requires further analysis
- One group's net value falls persistently → the factor may be usable in reverse
Factor Combination Methods
When multiple single factors pass validity tests, they should be combined into a composite factor:
Equal-Weight Combination
The simplest method: standardize each factor and sum them with equal weights. Suitable when the factor count is small and IC differences are minor.
Composite factor = Z(factor1) + Z(factor2) + ... + Z(factorN)
where Z() is cross-sectional Z-score standardization
IC-Weighted Combination
Assign weights according to historical IC mean. Factors with higher IC receive larger weights.
weight_i = |IC_mean_i| / sum(|IC_mean_j|)
Composite factor = sum(weight_i * Z(factor_i))
Orthogonalized Combination
First orthogonalize the factors with the Schm
よくある質問
ICは何を測りますか?
ファクターによる銘柄のランキングが、後のリターンのランキングとどれだけ一致するかです。
リターンは将来のものでなければならないのはなぜですか?
ファクターの日付より前のリターンを使うと、先読みバイアスになり、テストが信頼できなくなるからです。
ファクターを組み合わせられますか?
はい。有効なファクターを組み合わせるための、等ウェイトとICに基づく重み付けを扱います。
詳細
作者による元の説明
Factor research framework with IC/IR analysis, quantile backtesting, and factor combination. Suitable for cross-sectional factor evaluation across multiple instruments.
repo: HKUDS/Vibe-Trading
人気
- GitHubのスター
- 37k
- ランキング
- #7519
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
vibe-trading
37kバックテスト、ファクター分析、オプション価格、多くの市場にまたがる市場データを含む、金融リサーチの完全なツールキットをエージェントに与えます。
adr-hshare
37k中国企業が複数の市場に上場している価格差、例えば米国のADRと香港株の差を比べる方法をエージェントに示します。
akshare
37kエージェントが、APIキーなしで、中国と世界の株式、先物、外国為替、経済指標の無料の市場データを取得できるよう支援します。
alpha-zoo
37k既製のストックファクターのライブラリを閲覧し、選んだ市場で一群のファクターがリターンをどれだけ予測するかを検証できるよう支援します。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。