correlation-analysis
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
Skill by Serennity007
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/serennity007-correlation-analysis
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 2
api.coingecko.com· found in codecodeload.github.com· found in install command
Files it touches
~/.claude/skills/correlation-analysis
What's inside
- Skill name
correlation-analysis- Description
- Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
- License
- MIT
- Instructions
- 272 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (5)
- SKILL.md
- methodology.md · references/
- portfolio_applications.md · references/
- correlation_matrix.py · scripts/
- rolling_correlation.py · scripts/
SKILL.md (first lines)
# Correlation Analysis
Cross-asset correlation analysis for diversification assessment, risk management, pairs trading signal generation, and portfolio construction.
## Why Correlation Matters
Correlation measures how assets move together. In crypto markets this is critical for:
- **Diversification**: holding correlated assets provides no diversification benefit — you are effectively holding one concentrated position
- **Risk management**: portfolio risk depends on the correlation structure, not just individual asset volatility
- **Pairs trading**: highly correlated assets that temporarily diverge create mean-reversion opportunities
- **Portfolio construction**: optimal allocation requires accurate correlation estimates
- **Crash protection**: understanding tail dependence reveals whether assets crash together
## Correlation Methods
### Pearson Correlation
Linear correlation assuming normality. Most common but least robust for crypto.
```python
import pandas as pd
import numpy as np
# Always compute on returns, never on prices
returns_a = prices_a.pct_change().dropna()
returns_b = prices_b.pct_change().dropna()
pearson_corr = returns_a.corr(returns_b) # default is Pearson
```
- **Range**: -1 (perfect inverse) to +1 (perfect co-movement)
- **Assumes**: linear relationship, normally distributed returns, no outliers
- **Limitation**: crypto returns are heavy-tailed — Pearson underestimates extreme co-movement
### Spearman Rank Correlation
Converts values to ranks, then computes Pearson on ranks. Captures monotonic (not just linear) relationships.
```python
spearman_corr = returns_a.corr(returns_b, method='spearman')
```
- More robust to outliers and non-linear relationships
- Better for crypto due to heavy-tailed return distributions
- Slightly lower power than Pearson when normality holds
### Kendall Tau Correlation
Counts concordant vs discordant pairs. Most robust to outliers.
```python
kendall_corr = returns_a.corr(returns_b, method='kendall')
```
- Most robust to outliers of the three methods
- Computationally slower on large datasets
- Best for small samples or heavily skewed data
## Rolling Correlation
Static correlation hides regime changes. Rolling correlation reveals how relationships evolve.
### Window-Based Rolling Correlation
```python
# Rolling Pearson correlation
rolling_corr = returns_a.rolling(window=60).corr(returns_b)
# Multiple windows for different time horizons
windows = {
'short': 20, # ~1 month of trading days
'medium': 60, # ~3 months
'long': 120, # ~6 months
}
for label, w in windows.items():
df[f'corr_{label}'] = returns_a.rolling(w).corr(returns_b)
```
### EWMA Correlation
Exponentially weighted — more responsive to recent changes.
```python
def ewma_correlation(x: pd.Series, y: pd.Series, span: int = 60) -> pd.Series:
"""Compute EWMA correlation between two return series."""
cov_xy = x.mul(y).ewm(span=span).mean() - x.ewm(span=span).mean() * y.ewm(span=span).mean()
std_x = x.ewm(span=span).std()
std_y = y.ewm(span=span).std()
return cov_xy / (std_x * std_y)
```
### Typical Windows
| Window | Days | Use Case |
|--------|------|----------|
| Short | 20 | Tactical trading, pairs entry/exit |
| Medium | 60 | Strategy allocation, regime detection |
| Long | 120 | Portfolio construction, strategic allocation |
## Correlation Matrix Analysis
### Computing the Full Matrix
```python
# Build return matrix for multiple assets
returns = pd.DataFrame({
'BTC': btc_returns,
'ETH': eth_returns,
'SOL': sol_returns,
'AVAX': avax_returns,
})
# Correlation matrix (Pearson)
corr_matrix = returns.corr()
# Spearman (better for crypto)
spearman_matrix = returns.corr(method='spearman')
```From Serennity007/awesome-stock-quant-skills, MIT.
More from Serennity007/awesome-stock-quant-skills
- 0.618score
cost-basis-engine
agipro
Multi-method cost basis computation including specific identification, FIFO, LIFO, HIFO, and proportional average cost with partial sell handling
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
coingecko-api
Serennity007
Broad crypto market data from CoinGecko covering 13,000+ tokens.
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
feature-engineering
Serennity007
Feature construction from market data for ML trading models including price, volume, on-chain, and microstructure features
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
crypto-tax-export
agipro
Export trade history and tax calculations in formats compatible with Koinly, CoinTracker, CoinLedger, TokenTax, and IRS Form 8949
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
dex-pool-analysis
Serennity007
AMM pool mechanics comparison across Raydium, Orca, and Meteora including fee structures, pool types, creation patterns, and volume efficiency
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
custom-indicators
Serennity007
Crypto-native indicators including NVT ratio, exchange flow, funding rate signals, holder momentum, and smart money flow
SkillBFreshness: B★ 41Claude Code +9 - 0.617score
ibkr-options-assistant
Serennity007
Interactive Brokers options & stock trading assistant.
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
helius-api
Serennity007
Enhanced Solana RPC with DAS API, parsed transactions, webhooks, and priority fee estimation via Helius
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
birdeye-api
Serennity007
Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
cointegration-analysis
Serennity007
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
defillama-api
Serennity007
Free DeFi analytics across all chains — TVL, token prices, DEX volumes, fees/revenue, stablecoins, and bridges
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
dex-execution
Serennity007
Solana DEX swap execution via Jupiter aggregator including quoting, transaction building, signing, and confirmation
SkillBFreshness: B★ 41Claude Code +9
Signals
- Stars
- 41
- Forks
- 8
- Open issues
- 1
- Last commit (this folder)
- Aug 25, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Serennity007
- 0.618score
dex-pool-analysis
Serennity007
AMM pool mechanics comparison across Raydium, Orca, and Meteora including fee structures, pool types, creation patterns, and volume efficiency
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
custom-indicators
Serennity007
Crypto-native indicators including NVT ratio, exchange flow, funding rate signals, holder momentum, and smart money flow
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
coingecko-api
Serennity007
Broad crypto market data from CoinGecko covering 13,000+ tokens.
SkillBFreshness: B★ 41Claude Code +9 - 0.618score
feature-engineering
Serennity007
Feature construction from market data for ML trading models including price, volume, on-chain, and microstructure features
SkillBFreshness: B★ 41Claude Code +9 - 0.617score
ibkr-options-assistant
Serennity007
Interactive Brokers options & stock trading assistant.
SkillBFreshness: B★ 41Claude Code +9 - 0.615score
cointegration-analysis
Serennity007
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
SkillBFreshness: B★ 41Claude Code +9
Cite this page
correlation-analysis skill. Agent Mart. https://agentmart.dev/skills/serennity007-correlation-analysis (last updated 2026-10-24)