Calculate a volatility index for the weather, to wager if things have become more volatile over time
Find a file
Vincent Batts 53dcd9ee49 docs: update README, TODO, and CLAUDE.md to reflect current state
All five phases are implemented and tested. README now describes the
actual pipeline and usage. TODO marks completed work and lists next
steps. CLAUDE.md reflects the multi-file architecture, data flow,
and NOAA CSV format details.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 23:22:09 -04:00
data data/*: adding the CSV data I was working with 2026-04-30 22:31:17 -04:00
.gitignore *: TODOs and such 2026-04-30 22:46:11 -04:00
CLAUDE.md docs: update README, TODO, and CLAUDE.md to reflect current state 2026-04-30 23:22:09 -04:00
composite.go composite: fix stations subquery column name (id vs station_id) 2026-04-30 23:19:44 -04:00
db.go Restructure as multi-command CLI; add spatial station filtering and ingestion pipeline 2026-04-30 22:52:31 -04:00
go.mod Restructure as multi-command CLI; add spatial station filtering and ingestion pipeline 2026-04-30 22:52:31 -04:00
ingest.go ingest: fix CSV parser for NOAA wide format 2026-04-30 23:14:12 -04:00
LICENSE Initial commit 2026-05-01 02:30:28 +00:00
main.go Restructure as multi-command CLI; add spatial station filtering and ingestion pipeline 2026-04-30 22:52:31 -04:00
README.md docs: update README, TODO, and CLAUDE.md to reflect current state 2026-04-30 23:22:09 -04:00
station.go Restructure as multi-command CLI; add spatial station filtering and ingestion pipeline 2026-04-30 22:52:31 -04:00
TODO.md docs: update README, TODO, and CLAUDE.md to reflect current state 2026-04-30 23:22:09 -04:00
volatility.go Restructure as multi-command CLI; add spatial station filtering and ingestion pipeline 2026-04-30 22:52:31 -04:00

weather-vix

Notice: This is a fun project that might be informative for retrospect, but I would guess not great for forecasting. Further, it likely has zero business or investment significance.

Overview

Roald suggested that weather fluctuations have become more common lately. Earlier hot days and later cold days. Sudden changes within days of each other.

To deduce such volatility would need a mechanic of calculating this fluctuation — similar to the stock market ^VIX Volatility Index.

Approach

Weather stations open and close over the decades, each at a slightly different location and elevation. Naively comparing measurements across time mixes stations, introducing geographic noise. This tool addresses that by:

  1. Finding all NOAA GHCN-D stations within 50 km of a target point (zip 27612, Raleigh NC)
  2. Storing all historical daily observations (TMAX, TMIN, PRCP, SNOW, SNWD) in a local DuckDB database
  3. Computing a spatially-weighted composite temperature series — each station's daily reading weighted by 1/distance² to the target — so the series is stable even as stations appear and disappear
  4. Computing a rolling standard deviation of day-over-day TMAX changes (30/90/365-day windows), annualized

Current results: 343 stations, 3M+ observations from 1891 to present, producing ~49k composite dates and a full-length volatility index.

Usage

go build ./...

# Download NOAA data for all stations within 50 km of 27612 (cached in data/cache/)
./weather-vix ingest

# Compute spatially-weighted composite TMAX/TMIN series
./weather-vix composite

# Compute rolling volatility index (stores 30/90/365-day windows)
./weather-vix vix

# Query results directly
duckdb weather.db "SELECT date, value FROM volatility WHERE window_days=30 ORDER BY date DESC LIMIT 10;"

# Export to CSV for plotting
duckdb weather.db "COPY volatility TO 'volatility.csv' (HEADER, DELIMITER ',');"

Research Notes

  • Volatility definition: rolling std-dev of day-over-day TMAX delta, annualized (σ * sqrt(365))
  • Spatial weighting: inverse-distance-squared; stations at zero distance use an epsilon of 0.01 km²
  • Station coverage: USW/USC prefix stations (ASOS/COOP network) have century-long TMAX/TMIN records; US1NC* stations (CoCoRaHS citizen science) are denser but precipitation-only and recent

Open questions / future work

  • Seasonal decomposition to distinguish anomalous volatility from expected seasonal swings
  • Including PRCP as an additional volatility signal
  • Normalizing the VIX scale to a baseline period for interpretability
  • Geographical scope: currently Raleigh-area only; could parameterize target location

Data Sources

References