quantskills/agent-quantspace/analyze
- community
Checking that the SKILL.md file is still in the repository.
Use when tasks need factor diagnostics, IC/grouped return analysis, attribution, robustness checks, deterministic factor-mining evaluation, or time-series distribution and stationarity checks.
Install
npx vskill@latest install quantskills/agent-quantspace/analyzeSKILL.md
Analyze
Analyze is the research diagnostics boundary. Use it to understand factors, returns, attribution, robustness, and time-series behavior after data and signals have been produced. Strategy execution and portfolio construction live in skills.backtest.
AnalyzeFacade is the deterministic entrypoint for factor-mining preflight, evaluation, and explicit pool comparison. The facade is read-only (no implicit I/O), fails fast on hard preflight/alignment/causality failures before return evaluation, and returns analyze-native structured results. Formal portfolio returns and costs call skills.backtest.VectorBacktester by default; AnalyzeFacade(backtester_factory=...) can substitute the engine for evaluate, while the formal pool pair always uses VectorBacktester.
skills.analyze must not import skills.factor_mining, strategies, report rendering, controller/role/workflow code, or LLM SDKs; only tearsheet.py reads the store workspace paths (for its default output directory).
Install plotting and parallel-analysis dependencies with uv sync --extra analyze.
Public API
Components
| Module family | Purpose | |
|---|---|---|
facade / contracts | Deterministic entrypoint and analyze-native snapshots | |
validation / spec_checks / causality | Panel, formula structure, parameter, and prefix-causality checks | |
factor_evaluation / factor_robustness / factor_incremental | IC/quantiles/turnover, robustness, pool incremental | |
factor_analysis | IC statistics, grouped returns, winsorization helpers | |
factor_information | Horizon/Lag IC surfaces, HAC summaries, rank correlation, rolling correlation, and Top-N overlap | |
ts_analysis | KDE/QQ plots, Hurst, ADF, KPSS, trend scoring | |
attribution_* | Symbol/category PnL, Brinson, decision edges, ranking buckets, Shapley, robustness, stat tests | |
tearsheet | Single-factor four-panel PNG tearsheet |
Recipes
Deterministic factor-mining evaluation (via the factor_mining adapter)
Trust boundary (prefix recompute). BoundPrefixRecompute cannot be constructed publicly. The only production issuer is build_prefix_recompute_capability(*, factor: FactorSpec, execution=None) — it compiles the exact FactorSpec and optionally checks execution.callable_fingerprint. Analyze does not expose a public API that seals arbitrary callables with hash strings. Process trust boundary: private helpers remain importable in-process; orchestration policy must only use the build_prefix_recompute_capability adapter builder. Evaluate additionally requires an issued recompute to reproduce evaluated values (CAUSALITY_RECOMPUTE_VALUE_MISMATCH).
FunctionRef has no module allowlist. It may point to generated strategy code, skills.compute, or another importable local dependency. Analyze checks the research contract—fields, parameter/window/lag consistency, output alignment, and time causality—rather than treating the local Python module as untrusted.
Trust boundary (formal pool pair). Portfolio deltas require an officially issued FormalBacktestPair from run_official_formal_backtest_pair, which constructs module VectorBacktester twice on explicit before/after target weights (no caller factory). Issuance is a canonical digest over before/after result_df/executed_weights plus panel/candidate/pool/protocol/shared-sample/ target-weight hashes and engine name/version. The pair rejects ordinary setattr after freeze; is_issued() recomputes the digest so object.__setattr__ tampering invalidates compare. There is no helper that accepts caller-supplied BacktestResult objects as verified.
Protocol vs Brief authority. Brief owns horizon/rebalance/cost/universe/ execution_delay_bars (mapped to signal_lag). trade_at and return_mode are Analyze/ProtocolSnapshot fields with no Brief counterpart — they are not silently inferred from Brief; callers must set them on the protocol.
Execution-aligned labels. Predictive IC, group returns, and pool residual / R² use one canonical label: forward P[t+L+H]/P[t+L]-1 or backward P[t+L]/P[t+L-H]-1 on protocol.trade_at prices, with signal_lag=L and holding window horizon_bars=H. Formal trading asserts the same semantics and is unavailable for horizon_bars != 1 (one-bar VectorBacktester limit) or return_mode != "forward".
Overlapping horizons (horizon_bars > 1) mark iid IC t-tests unavailable and report Newey–West HAC t/se/p instead. Pool marginal value is joint CS R² delta / residual IC under residual df and full-rank checks — never candidate IC minus mean member IC, and never saturated n == n_params mechanical R²=1.
Horizon IC and Lagged IC
Both return ICInformationResult(summary, daily_ic). Horizon IC fixes lag=0; Lagged IC changes signal-use delay independently of the return horizon. The execution-aligned return is P[t+signal_lag+lag+horizon] / P[t+signal_lag+lag] - 1, and each summary row uses Newey-West lag horizon-1.
Factor evaluation (IC_stat / group_stat)
group_stat semantics: n is the rebalance period only (regroup every n bars on the rebalance-day factor). group_return is always one-bar forward returns (close.pct_change().shift(-1), equal-weight within each group, daily rebalanced to equal weight), so (1 + group_return).cumprod() is a valid NAV for any n. Do not feed it n-bar returns: that would count each holding window n times. IC_stat(n=...) is different and correctly uses the n-bar forward return as its label.
Time-series stationarity check
Return-distribution KDE and QQ analysis
The input is a price-level series. The combined chart and CSV summarize standardized log-return distributions for lags 1 through 34; QQ theoretical quantiles are deterministic standard-normal quantiles.
CLI command reference
<!-- BEGIN GENERATED: qs commands -->
Transport: --input-json FILE|-, --preview N, and --log-level LEVEL; flags override JSON. Use --print-template [FIELD] for fillable templates.
Shared parameter groups
PanelSource
| Option | Type / default | Description | |
|---|---|---|---|
--panel | path? / null | Parquet/CSV panel, mutually exclusive with symbols or symbols-file. | |
--symbols | list[string] / factory | QuantSpace symbols such as SHSE.510300; repeat flag or comma-separate. | |
--symbols-file | path? / null | Text lines or JSON list of QuantSpace symbols. | |
--frequency | string / 1d | Market store directory under data/market, for example 1d or 1d_adj. | |
--data-root | path? / null | Managed data root; otherwise QUANTSPACE_DATA_ROOT or repository data/. | |
--start | string? / null | Inclusive start date: YYYY-MM-DD or YYYYMMDD. | |
--end | string? / null | Inclusive end date: YYYY-MM-DD or YYYYMMDD. | |
--fields | list[string] / factory | Optional panel field subset. |
uv run qs analyze factor-ic
IC statistics and grouped returns with full_stat.
Priority: P0. Side effects: read-only, writes-output.
Shared parameters: PanelSource.
| Option | Type / default | Description | |
|---|---|---|---|
--factor | path / required | Long factor table indexed by symbol and eob with one value column. | |
--horizon | integer / 1 | Rebalance period n in bars. | |
--groups | integer / 5 | Number of factor quantile groups g. | |
--pearson | boolean / false | Use Pearson IC instead of rank IC. | |
--out-dir | path? / null | Optional directory for ic_series, group_return and turnover Parquet files. | |
--tearsheet | path? / null | Optional .png path for the 4-panel factor tearsheet (generate_factor_tearsheet). | |
--name | string? / null | Factor label on the tearsheet; defaults to the --factor file stem. | |
--namespace | string / - | Namespace label printed in the tearsheet title. | |
--overwrite | boolean / false | Replace existing output files. |
Output data fields: ic_stats, group_mean_return, ic_rows, group_rows, turnover_rows.
Inspect schemas: uv run qs schema analyze.factor-ic (add --part input|output or --file-field FIELD).
uv run qs analyze ic-surface
Execution-aligned factor x horizon x lag rank-IC surface with HAC summaries.
Priority: P1. Side effects: read-only, writes-output.
Shared parameters: PanelSource.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/analyze/SKILL.md
Popularity
- Repository stars
- 57
- Repository forks
- 11
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/quantskills/agent-quantspace/analyze)