- Go 100%
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> |
||
|---|---|---|
| data | ||
| .gitignore | ||
| CLAUDE.md | ||
| composite.go | ||
| db.go | ||
| go.mod | ||
| ingest.go | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| station.go | ||
| TODO.md | ||
| volatility.go | ||
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:
- Finding all NOAA GHCN-D stations within 50 km of a target point (zip 27612, Raleigh NC)
- Storing all historical daily observations (TMAX, TMIN, PRCP, SNOW, SNWD) in a local DuckDB database
- 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
- 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
- NOAA Global Historical Climatology Network Daily (GHCN-D)
- Station list:
ghcnd-stations.txt/ghcnd-stations.csv - Per-station daily CSVs:
.../access/<STATION_ID>.csv
- Station list: