analyze-gas-fertilizer-contract-shock

Analyze daily natural gas and fertilizer price series to test shock-driven narratives.

3|1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/fatfingererr/macro-skills --skill analyze-gas-fertilizer-contract-shock
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyze-gas-fertilizer-contract-shock
Source: https://github.com/fatfingererr/macro-skills/tree/main/skills/analyze-gas-fertilizer-contract-shock
Command: npx skills add https://github.com/fatfingererr/macro-skills --skill analyze-gas-fertilizer-contract-shock

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill analyzes daily price data to determine whether a natural gas price shock leads to fertilizer price spikes, providing a quantitative, narrative-verification framework instead of guesswork.

Core Features & Use Cases

  • Narrative verification: test the claim that gas shocks cause fertilizer spikes using a transparent three-part causal framework (A: gas shock; B: fert spike; C: lead-lag).
  • Regime detection & visualization: detect and label gas shock regimes and fertilizer spike regimes with start/end dates, magnitudes and durations, plus Bloomberg-style visualizations.
  • Decision support: outputs structured results (JSON/Markdown-ready) for macro research, risk assessment, or contract-hedging narratives.
  • Use cases include validating public narratives for policy or industry risk, academic analysis of energy–agriculture linkages, and teaching causality in time-series.

Quick Start

  • Install prerequisites: pip install pandas numpy requests websocket-client matplotlib scipy
  • Fetch data: python scripts/fetch_te_data.py --symbol natural-gas --symbol urea
  • Run analysis: python scripts/gas_fertilizer_analyzer.py --gas-file data/cache/natural-gas.csv --fert-file data/cache/urea.csv --start 2025-08-01 --end 2026-02-01 --output data/analysis_result.json
  • Generate visualization: python scripts/visualize_shock_regimes.py --data data/analysis_result.json --output output/gas_fert_shock.png

Frequently Asked Questions about analyze-gas-fertilizer-contract-shock

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

FAQPage Schema
How do I test whether a natural gas shock causes fertilizer price spikes using time-series data?

To test whether a natural gas shock causes fertilizer price spikes, you analyze daily price series using a three-part causal framework identifying gas shocks, fertilizer spikes, and lead-lag relations. The tool compares shock regimes to deliver structured assessments and visualizations.

What is the best way to detect lead-lag relations between gas and fertilizer prices?

Detecting lead-lag relations between gas and fertilizer prices involves cross-correlation analysis on daily price series. This Skill applies shock detection to label regime start and end dates, then measures the timing and magnitude of price movements across the two series.

How do I fetch daily price data and run a gas fertilizer shock analysis in Python?

Fetch daily price data by running the fetch script with specified symbols like natural-gas and urea. Then execute the analyzer script with the CSV file paths, date range, and output parameters to generate structured JSON results for macro research.

Can I use pandas and scipy to visualize natural gas shock regimes for risk analysis?

Yes, you can use pandas and scipy alongside matplotlib to visualize natural gas shock regimes for risk analysis. The Skill generates Bloomberg-style visualizations labeling shock start and end dates, magnitudes, and durations suitable for contract-hedging narratives.

Does this shock detection approach work for academic analysis of energy and agriculture price linkages?

Yes, this shock detection approach works for academic analysis of energy and agriculture price linkages. It provides a transparent causal framework comparing shock regimes and lead-lag relations, suitable for teaching causality in time-series and validating public narratives.

What are the limitations of using cross-correlation for narrative verification in commodity markets?

Using cross-correlation for narrative verification in commodity markets limits causal inference to temporal timing rather than structural economic modeling. This approach detects regime timing and magnitude but should be supplemented with domain knowledge for comprehensive risk assessment.