forecast-sector-relative-return-from-yield-spread

Analyze yield-curve spread lead-lag relationships to forecast sector relative returns.

3|1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/fatfingererr/macro-skills --skill forecast-sector-relative-return-from-yield-spread
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forecast-sector-relative-return-from-yield-spread
Source: https://github.com/fatfingererr/macro-skills/tree/main/skills/forecast-sector-relative-return-from-yield-spread
Command: npx skills add https://github.com/fatfingererr/macro-skills --skill forecast-sector-relative-return-from-yield-spread

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, yfinance, requests, scipy, matplotlib, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill analyzes the lead-lag relationship between US yield-curve spread (2Y-10Y) and sector relative performance (QQQ vs XLV), providing data-driven forecasts and interpretable outputs to support cross-asset allocation decisions.

Core Features & Use Cases

  • Lead-lag analysis: quantify how current yield-curve shape relates to future relative performance of growth versus defensive sectors.
  • Data integration & processing: fetches yield data from FRED and price data from Yahoo Finance, computes spread and relative ratio, and supports multiple lead times.
  • Forecasting & reporting: outputs structured results (JSON/Markdown) with point estimates, confidence intervals, and stability checks for informed decision making.

Quick Start

Run a quick analysis with default parameters to see the current forecast:

  • cd skills/forecast-sector-relative-return-from-yield-spread
  • python scripts/spread_forecaster.py --quick

Frequently Asked Questions about forecast-sector-relative-return-from-yield-spread

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

FAQPage Schema
How do I forecast sector relative returns using the yield curve spread?

Yield curve spread forecasting predicts sector relative performance by quantifying the lead-lag relationship between the 2Y-10Y US Treasury spread and sector ratios like QQQ vs XLV. It fetches FRED and Yahoo Finance data, applies regression, and outputs point estimates with confidence intervals.

What is the lead-lag relationship between yield curves and growth vs defensive sectors?

The lead-lag relationship between yield curves and growth vs defensive sectors measures how current yield-curve shape predicts future relative performance. This Skill quantifies that timing delay using regression to support cross-asset allocation decisions between growth and defensive sector rotations.

Can I use yfinance and pandas to predict QQQ vs XLV performance from Treasury yields?

Yes, you can use yfinance and pandas to predict QQQ vs XLV performance from Treasury yields. This Skill uses yfinance to fetch price data, pandas and numpy to compute the relative ratio, and scipy to perform the regression analysis on the FRED yield data.

How do I run a quick yield-curve spread analysis in Python?

To run a quick yield-curve spread analysis in Python, execute the script with default parameters using the command line interface. Navigate to the Skill directory and run the spread forecaster script with the quick flag to instantly view the current forecast and visualization outputs.

What data sources do I need for analyzing yield-curve spreads and sector rotations?

Analyzing yield-curve spreads and sector rotations requires US Treasury yield data from FRED and sector price data from Yahoo Finance. The process computes the 2Y-10Y spread and sector relative ratios, utilizing requests for data fetching and matplotlib for visualizing the regression results.

Does this yield-curve spread forecasting approach support multiple lead times?

Yes, this yield-curve spread forecasting approach supports multiple lead times to quantify how current yield-curve shapes relate to future performance. It outputs structured JSON and Markdown results with point estimates, confidence intervals, and stability checks for informed decision making.