# Inflation Regimes and Commodity-Producer Equity Sensitivity

This is a revised and audited version of an independent empirical research project completed in 2026.

## Central finding

The revised analysis supports one narrow result: **Brent returns had a materially stronger relationship with US energy-equity returns when inflation was already elevated**. The original claims about a statistically reliable high-inflation shift in gold sensitivity do not survive the corrected specification. Copper remains positively related to mining equities, but its regime difference is not statistically precise at the primary 3% threshold.

## Why the project was revised

The original data pipeline forward-filled missing futures prices before calculating returns. That created 14 artificial observations in which Brent, gold and copper returns were all exactly zero while XLE and XME moved. The original analysis also split the sample into separate regressions and relied on conventional standard errors.

The revised workflow:

- removes the 14 artificial zero-return rows;
- uses 89 usable monthly observations;
- classifies regimes using prior-month headline CPI;
- estimates full-sample interaction models;
- uses Newey-West/HAC standard errors with three lags;
- reports threshold robustness tests; and
- preserves the original prepared dataset and data-quality log for transparency.

## Project structure

```text
commodity-project/
├── commodity_regime_analysis.py
├── requirements.txt
├── README.md
├── CHANGELOG.md
├── data/
│   ├── raw/
│   └── processed/
├── docs/
│   ├── methodology.md
│   ├── revised_findings.md
│   └── sources.md
├── figures/
├── outputs/
└── model/
    └── commodity_regime_model.xlsx
```

## Run the analysis

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python commodity_regime_analysis.py
```

The script writes the cleaned model dataset, data-quality log, regression tables, robustness results, model summaries, analytical figures and the generated findings note. Counts and dates in the findings note are derived from the retained data rather than maintained as separate text.

The website also includes presentation-layer SVG figures generated from the committed CSV and JSON outputs. These are visually reformatted for the publication but do not change the underlying estimates.

## Spreadsheet model

`model/commodity_regime_model.xlsx` provides a reviewable Excel model with:

- an executive dashboard;
- model assumptions;
- the retained raw dataset and exclusion flags;
- the 89-observation model dataset;
- primary regression results;
- threshold robustness; and
- source and limitation notes.

The HAC regression estimates are generated by the Python model and loaded into the workbook. Data-quality flags, regime classification and interaction fields are shown explicitly for auditability.

## Scope

This project is an empirical association study, not an investment recommendation and not a causal estimate.
