correlation-analysis

Identify correlated assets and validate long-run co-movement for pairs trading.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/loanntc/Paave --skill correlation-analysis-loanntc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: correlation-analysis
Source: https://github.com/loanntc/Paave/tree/main/skills/correlation-analysis
Command: npx skills add https://github.com/loanntc/Paave --skill correlation-analysis-loanntc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps analysts identify strong co-movement and long-run relationships between assets so they can build and validate pairs-trading candidates instead of relying on correlation alone.

Core Features & Use Cases

  • Co-Movement Discovery: Scan a universe by Pearson/Spearman correlations and shortlist Top-K candidates for follow-up testing.
  • Deep Return-Correlation Analysis: Compute multiple correlation measures (Pearson, Spearman, Kendall), OLS beta/R², rolling correlation, and spread Z-scores.
  • Sector Clustering: Use hierarchical clustering on the correlation matrix to uncover sector-like structure and diversify exposures.
  • Realized (Regime-Conditional) Correlation: Measure rolling correlation and analyze how correlation changes under bull/bear/sideways/high-vol regimes.
  • Cointegration Testing Framework: Run Engle-Granger and Johansen cointegration tests to confirm long-run equilibrium relationships.
  • Pairs Trading Readiness Metrics: Estimate spread half-life and (optionally) use a Kalman filter for a dynamic hedge ratio.
  • Signal Generation Workflow: Convert correlation/cointegration results into actionable Z-score-based long/short/exit signals.

Quick Start

Use correlation-analysis to scan a candidate universe, test cointegration, estimate half-life and (optionally) dynamic hedge ratios, and output Z-score-based pair-trading signals from two asset price series.

Frequently Asked Questions about correlation-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test cointegration for pairs trading and generate entry signals?

To test cointegration for pairs trading, run Engle-Granger or Johansen tests on asset price series to confirm long-run equilibrium, estimate spread half-life, and generate long/short/exit signals from rolling spread Z-scores.

What is the difference between correlation and cointegration when screening asset pairs?

Correlation measures short-term co-movement using Pearson or Spearman metrics, while cointegration validates a long-run equilibrium relationship between assets, ensuring that paired price series will not drift apart permanently over time.

How do I calculate a dynamic hedge ratio using a Kalman filter for spread trading?

Calculate a dynamic hedge ratio by applying a Kalman filter to your asset pair's price series, which adjusts the weighting continuously to maintain an optimal spread for Z-score signal generation and pairs trading.

Can I use hierarchical sector clustering to diversify my portfolio exposure?

Yes, you can use hierarchical sector clustering on a correlation matrix to uncover underlying sector-like structures, group similar assets, and effectively diversify your portfolio exposures across distinct market clusters.

Does rolling realized correlation change across different market regimes?

Rolling realized correlation changes significantly across bull, bear, sideways, and high-volatility market regimes, requiring regime-conditional analysis to accurately measure how asset co-movement shifts under varying market conditions.

What are the limitations of using correlation alone for pairs trading?

Relying on correlation alone for pairs trading is limited because high correlation does not guarantee long-run equilibrium, making it necessary to run cointegration tests and estimate half-life to avoid divergent spread dynamics.