Nixtla Correlation Mapper

VerifiedCaution

Analyzes correlations between multiple contracts from CSV data (price or value) to recommend hedging strategies for portfolio risk management. Computes a correlation matrix, identifies significant pairs, and generates optimal hedge ratios (OLS, minimum variance). Useful when managing correlated assets, with visualizations (heatmap, rolling correlations) and export of recommendations.

Sby Skills Guide Bot
Data & AIIntermediate
3/4/2026
Claude Code
#correlation-analysis#hedging#time-series#portfolio-risk#forecasting

Recommended for

Automated summary

This skill analyzes correlations between multiple contracts from a time-series CSV and produces hedge recommendations together with charts and a Markdown report.

Strengths

  • End-to-end five-step pipeline: data prep, correlation matrix, hedge ratios, visualizations, and report
  • Solid statistical output including p-values, rolling correlations, and both OLS and minimum-variance methods
  • Directly usable artifacts: heatmap, rolling correlation chart, hedged portfolio CSV

Limitations

  • Assumes a strict input schema (unique_id, ds, y) and does not describe handling of missing or outlier values
  • Historical correlations do not guarantee future relationships; forecasted correlations require an optional external API key
  • Relies on local Python scripts (pandas, scipy, seaborn) that are not included in the SKILL.md
When to use it

Use it when a multi-contract portfolio needs to be screened for correlated pairs and hedge ratios estimated.

When not to use it

Avoid it when the data is not in long-format time series or when portfolio risk analysis is not the goal.

Security analysis

Caution
Quality score84/100

The skill is a legitimate data-analysis workflow for correlation and hedging calculations. It does not instruct destructive actions, credential exfiltration, obfuscated payloads, or disabling safety controls. However, it uses Bash to run Python scripts that are referenced but not embedded, so a cautious rating is appropriate until the scripts are reviewed.

Findings
  • •Instructions execute bundled Python scripts via Bash(python:*), but the script contents are not included in the SKILL.md, so their behavior cannot be fully verified from the provided file.
  • •Writes multiple output files and JSON/CSV/PNG artifacts to a results directory; this is legitimate but should be run in an appropriate workspace.
How this analysis is made

Examples

Analyze correlations
Analyze correlations in contracts.csv using log returns with a 0.5 threshold and a 30-day rolling window, then save everything to results/.
Suggest a hedge
Suggest hedge recommendations for my portfolio of energy contracts in contracts.csv, using OLS hedge ratios and a portfolio value of 100000.
Full report
Run the full correlation workflow on contracts.csv and generate correlation_report.md with the heatmap and hedge effectiveness chart.

name: nixtla-correlation-mapper description: "Analyze multi-contract correlations for forecast-based hedge recommendations. Use when managing correlated assets. Trigger with 'analyze correlations' or 'suggest hedge'." version: "1.0.0" author: "Jeremy Longshore jeremy@intentsolutions.io" license: MIT allowed-tools: "Read,Write,Bash(python:*),Glob,Grep"

Nixtla Correlation Mapper

Identifies correlations between multiple contracts and generates hedging strategies for portfolio risk management.

Overview

Analyzes relationships between assets in a portfolio to suggest hedging strategies. Takes CSV data with multiple time series, calculates correlation matrix, identifies significant relationships, and outputs hedge recommendations with visualizations. Generates correlation heatmap, rolling correlation plots, and hedge effectiveness charts.

Prerequisites

Tools: Read, Write, Bash, Glob, Grep

Environment: None required (optional: NIXTLA_TIMEGPT_API_KEY for forecasted correlations)

Packages:

pip install pandas numpy scipy matplotlib seaborn

Input Format: CSV with columns: unique_id (contract identifier), ds (date), y (price/value)

Instructions

Step 1: Prepare Data

Load multi-series contract data and calculate returns. Uses {baseDir}/scripts/prepare_data.py.

python scripts/prepare_data.py contracts.csv --method log --output-dir results/

Output: prices_wide.csv, returns.csv

Step 2: Calculate Correlations

Calculate correlation matrix and identify significant pairs. Uses {baseDir}/scripts/correlation_analysis.py.

python scripts/correlation_analysis.py \
  --returns results/returns.csv \
  --method pearson \
  --threshold 0.5 \
  --rolling-window 30 \
  --output-dir results/

Output: correlation_matrix.csv, correlation_pvalues.csv, high_correlations.json, rolling_correlations.csv

Step 3: Generate Hedge Recommendations

Calculate optimal hedge ratios using regression or minimum variance methods. Uses {baseDir}/scripts/hedge_recommendations.py.

python scripts/hedge_recommendations.py \
  --returns results/returns.csv \
  --correlation results/correlation_matrix.csv \
  --method ols \
  --top-n 10 \
  --portfolio-value 100000 \
  --output-dir results/

Output: hedge_recommendations.csv, hedge_recommendations.json, hedged_portfolio.csv

Step 4: Create Visualizations

Generate correlation heatmap, rolling correlation plot, and hedge effectiveness chart. Uses {baseDir}/scripts/visualize.py.

python scripts/visualize.py \
  --correlation results/correlation_matrix.csv \
  --rolling results/rolling_correlations.csv \
  --recommendations results/hedge_recommendations.json \
  --output-dir results/ \
  --top-n 5

Output: correlation_heatmap.png, rolling_correlation.png, hedge_effectiveness.png

Step 5: Generate Report

Create comprehensive markdown report with all analysis results. Uses {baseDir}/scripts/generate_report.py.

python scripts/generate_report.py \
  --correlation results/correlation_matrix.csv \
  --high-correlations results/high_correlations.json \
  --recommendations results/hedge_recommendations.json \
  --output results/correlation_report.md

Output: correlation_report.md

Output

  • correlation_matrix.csv: Full pairwise correlation matrix
  • correlation_heatmap.png: Visual correlation heatmap
  • correlation_pvalues.csv: Statistical significance p-values
  • high_correlations.json: Pairs exceeding correlation threshold
  • hedge_recommendations.csv: Detailed hedging strategies with ratios
  • hedged_portfolio.csv: Sample portfolio allocation with long/short positions
  • rolling_correlations.csv: Time-series correlation stability
  • rolling_correlation.png: Rolling correlation visualization
  • hedge_effectiveness.png: Variance reduction by contract pair
  • correlation_report.md: Comprehensive analysis report

Error Handling

Error: Input file not found

  • Verify file path with ls -la
  • Check current directory and use absolute paths

Error: Missing required columns

  • Ensure CSV has unique_id, ds, y columns
  • Verify column names match exactly (case-sensitive)

Error: Insufficient data points

  • Need at least 30 data points per contract for reliable correlations
  • Verify data has sufficient time-series history

Error: Invalid data format

  • Check that y values are numeric (not strings)
  • Ensure dates are parseable (ISO format recommended)
  • Remove or handle missing values

Error: Insufficient contracts

  • Need at least 2 contracts for correlation analysis
  • Verify unique_id column has multiple distinct values

Examples

Example 1: Crypto Portfolio

Input (portfolio.csv):

unique_id,ds,y
BTC,2024-01-01,42000
ETH,2024-01-01,2200
BTC,2024-01-02,42500
ETH,2024-01-02,2250

Workflow:

python scripts/prepare_data.py portfolio.csv
python scripts/correlation_analysis.py
python scripts/hedge_recommendations.py
python scripts/visualize.py
python scripts/generate_report.py

Result: Correlation 0.85 between BTC-ETH, hedge ratio -0.95, variance reduction 72%

Example 2: Prediction Market Contracts

Input: 5 election-related prediction market contracts

Command:

python scripts/prepare_data.py elections.csv --output-dir election_analysis/
python scripts/correlation_analysis.py --threshold 0.7 --output-dir election_analysis/
python scripts/hedge_recommendations.py --top-n 5 --output-dir election_analysis/
python scripts/visualize.py --output-dir election_analysis/
python scripts/generate_report.py --output election_analysis/report.md

Result: Identified 3 pairs with correlation > 0.7, top hedge reduces variance by 62%

Resources

Scripts: All analysis scripts located in {baseDir}/scripts/

  • prepare_data.py: Data loading, pivoting, returns calculation
  • correlation_analysis.py: Correlation matrix, p-values, rolling correlations
  • hedge_recommendations.py: Hedge ratios, portfolio allocation
  • visualize.py: Heatmaps, rolling plots, effectiveness charts
  • generate_report.py: Comprehensive markdown report

Correlation Methods: Pearson (linear), Spearman (rank-based), Kendall (concordance)

Hedge Methods: OLS regression (standard), Minimum variance (risk-minimizing)

Interpretation:

  • Strong correlation: |r| > 0.7 (high co-movement)
  • Moderate: 0.3 < |r| < 0.7 (partial relationship)
  • Weak: |r| < 0.3 (minimal relationship)
  • Negative correlation: r < -0.5 (good hedge potential)

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/nixtla-correlation-mapper-mmbizk1a' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/nixtla-correlation-mapper-mmbizk1a/download' --output '.skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md.part' && mv '.skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md.part' '.skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read,Write,Bash(python:*),Glob,Grep

Original excerpt: Prerequisites

Tools: Read, Write, Bash, Glob, Grep

Environment: None required (optional: NIXTLA_TIMEGPT_API_KEY for forecasted correlations)

Packages:

pip install pandas numpy scipy matplotlib seaborn

Input Format: CSV with columns: unique_id (contract identifier), ds (date), y (price/value)

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md' && test -s '.skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/nixtla-correlation-mapper' && cp -R '.skill-downloads/nixtla-correlation-mapper-mmbizk1a' '.claude/skills/nixtla-correlation-mapper'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/nixtla-correlation-mapper-mmbizk1a'

openskills read 'nixtla-correlation-mapper-mmbizk1a'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/nixtla-correlation-mapper-mmbizk1a/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills