Last updated: 2026-11-30
Open the web app. Read the plain-language explainer. Read the ERGIS oil well documentation for the original study and the method.
This study uses the method of the ERGIS oil well study on public US wind data. The question is: how much does the capacity factor of a new wind plant change for each 100 MW of older turbines nearby?
A plant is one EIA wind power plant: a group of turbines that reports generation together. The capacity factor (CF) of a plant is its generation divided by its capacity × 8,760 hours. An older turbine upwind slows the wind for the turbines behind it. This loss is a wake. Dense areas also share transmission lines. Thus the effect also contains curtailment: generation that the grid operator stops.
The study uses Double Machine Learning (DML) to remove confounding. The ERGIS documentation, section 2.3, gives the method. The study adds a GWR step that examines whether the effect changes with location.
The study has three parts:
wind.py: a command-line script. It downloads the data, calculates the estimates and writes the app data. It uses the estimators of dml.py.docs/wind-app/: a single-page web app that shows the plants and the results on a map.WIND.md: the full report. DATASETS.md lists other public datasets for the method.wind.py. The DML estimators are the functions of dml.py.fetch() downloads the USGS turbine database and the EIA-923 files for 2011 to 2024 one time. It keeps uswtdb.csv, gen.csv and VERSION in data/wind/.load() reads the onshore turbines and makes one row for each plant. A plant needs a known size and year for each turbine. Turbines with no recorded size get the mean size of turbines built within 2 years.build() selects the study plants and makes Y, D and X.run() and run_rings() from dml.py calculate the naive, PLR, IRM and ring estimates. wind.py gives them its own printed labels.local_gwr() fits a local regression at each plant on the PLR residuals. placebo() examines how many plants it marks by chance.| Variable | Definition |
|---|---|
| Study plant | An onshore plant whose turbines all came online in one year (one phase), from 2010 to 2023, with a CF for the next full year. |
| Outcome Y | Natural logarithm of the CF in the first full calendar year after the online year. CF values outside 0.05 to 0.70, and years from a repowering on, are removed. |
| Treatment D | Capacity of turbines from an earlier project year within 10 km of each turbine of the plant, averaged over the turbines of the plant, in units of 100 MW. |
| Confounders X | Longitude, latitude, online year, turbine count, hub height, rotor diameter, specific power, manufacturer code, log MW, and two resource values. |
| Resource values | Mean log CF, and number, of plant-years of other plants within 50 km, only in years before the study plant came online. |
| Block | A 100 km grid square (248 blocks). The folds and the clustered standard errors use the blocks. |
Geographically weighted regression (GWR) fits one weighted regression at each location. Near points get large weights. local_gwr() uses these rules:
gwr() agrees with PySAL mgwr to 1e-8 (mgwr bw = k + 1).The web app is one HTML page with plain JavaScript and no build step. It uses the ArcGIS Maps SDK for JavaScript 5.2 from the CDN (<arcgis-map> component).
index.html: the page, the map component and the three views.app.js: the router, the map layers (one for each fit), the panel and the charts.style.css: the layout, with light and dark colors.data/wind-cv.geojson: the plants with the GWR fit that cross-validation selected.data/wind-k100.geojson: the plants with a forced local GWR fit, k = 100.The app has three views. The URL hash selects the view: #/map, #/results and #/about. The map stays loaded below the other views.
| Item | Requirement | Version used for the results |
|---|---|---|
| Operating system | macOS (the only system tested) | Darwin 27.2.0, Apple silicon |
| uv | Installed and on the path | 0.13.10 |
| Python | 3.12 or 3.13 (pyproject.toml) | 3.13.7 |
| Python packages | duckdb with the excel extension, numpy, scikit-learn, scipy | duckdb 2.0.1, numpy 2.5.5, scikit-learn 1.9.1, scipy 1.18.1 |
| Wind data | Internet access for the first run. The script downloads approximately 300 MB and keeps 15 MB. | USWTDB v9.1 (uswtdb_V9_1_20260928.csv), EIA-923 2011–2024 downloaded 2026-11-30 |
| Web app | A browser with WebGL and internet access to js.arcgis.com | ArcGIS Maps SDK for JavaScript 5.2 (latest release 5.2.9) |
The study does not need the ERGIS database.
cd double-machine-learninguv syncdata/wind/.
uv run wind.py --selftest
The last line shows selftest ok.| Option | Type | Default | Effect |
|---|---|---|---|
--radius-km | number, km | 10 | The largest distance between a turbine of the study plant and an older turbine. |
--rings | numbers, km | 5 10 20 40 | Outer edges of the distance rings. They must be positive and in increasing order. |
--years | two integers | 2010 2023 | First and last online year of the study plants. The outcome is the next calendar year. |
--geojson | path | none | If set, the script writes the GWR effect of each plant to this GeoJSON file. |
--neighbours | integer | none (cross-validation) | Sets the GWR bandwidth to this neighbour count. 0 is one global slope. The value must be less than the number of plants. |
--geojson-forced | integer and path | none | Also writes a second GeoJSON with the GWR fit forced to K neighbours. It uses the DML and ring estimates of the same run. |
--placebo | integer | 50 | Number of shuffle placebo repetitions. 0 stops the placebo. |
--selftest | flag | off | Runs the self-test: five hand-made plants, then the real plant positions with synthetic outcomes. |
wind.py| Name | Value | Effect |
|---|---|---|
GEN_YEARS | 2011 to 2024 | EIA-923 years to download. Files before 2011 are .xls, which DuckDB cannot read. |
PER | 100 MW | Unit of D. |
RESOURCE_KM | 50 km | Search distance for the resource values. |
BLOCK_KM | 100 km | Block size for the folds, the clustered standard errors and the GWR cross-validation. |
NEIGHBOURS | 25, 50, 100, 200, 400, 0 | Neighbour counts that the cross-validation compares. 0 is one global slope. |
LABELS | dictionary | Printed labels for run() and run_rings(). dml.py has its own LABELS for wells. |
uv run wind.pydata/wind/VERSION.data: uswtdb_V9_1_20260928.csv; EIA-923 2011-2024 downloaded 2026-11-30
US onshore wind: log capacity factor in the first full year, older turbine capacity within 10 km of each of the plant's turbines, online 2010-2023
mean capacity factor 0.366
plants 781 blocks 248 mean 100 MW of older turbines 0.69 share with older turbines 0.56
effect on log(outcome):
naive OLS, per 100 MW older turbines -0.0086 se 0.0026 95% CI [-0.0137, -0.0034]
DML PLR, per 100 MW older turbines -0.0012 se 0.0039 95% CI [-0.0088, +0.0064] out-of-fold R2: Y 0.48, D 0.04
naive difference, older turbines nearby vs none +0.0239 se 0.0252 95% CI [-0.0255, +0.0732]
DML IRM (ATE), older turbines nearby vs none +0.0014 se 0.0215 95% CI [-0.0408, +0.0435] propensities clipped: 0.0%
rings, mean 100 MW of older turbines: 0–5 km 0.20, 5–10 km 0.49, 10–20 km 0.92, 20–40 km 2.05
naive OLS, per 100 MW older turbines 0–5 km +0.0030 se 0.0294 95% CI [-0.0547, +0.0607]
DML PLR, per 100 MW older turbines 0–5 km +0.0288 se 0.0308 95% CI [-0.0315, +0.0891] out-of-fold R2 D 0.06
naive OLS, per 100 MW older turbines 5–10 km -0.0228 se 0.0173 95% CI [-0.0567, +0.0111]
DML PLR, per 100 MW older turbines 5–10 km -0.0217 se 0.0171 95% CI [-0.0552, +0.0118] out-of-fold R2 D 0.02
naive OLS, per 100 MW older turbines 10–20 km +0.0116 se 0.0070 95% CI [-0.0022, +0.0253]
DML PLR, per 100 MW older turbines 10–20 km +0.0117 se 0.0087 95% CI [-0.0054, +0.0288] out-of-fold R2 D 0.29
naive OLS, per 100 MW older turbines 20–40 km +0.0079 se 0.0066 95% CI [-0.0050, +0.0209]
DML PLR, per 100 MW older turbines 20–40 km -0.0031 se 0.0051 95% CI [-0.0132, +0.0069] out-of-fold R2 D 0.40
GWR on the PLR residuals (per 100 MW older capacity):
block-CV MSE by neighbours: 25 0.07962, 50 0.05716, 100 0.05277, 200 0.05226, 400 0.05200, global 0.05171
chosen global (median bandwidth inf km), effective parameters 2.0, adjusted |t| > 1.96 (unadjusted 1.96)
local slopes: median -0.0014, 10-90% [-0.0014, -0.0014]
plants that differ from the overall -0.0014: adjusted 0.0%, unadjusted 0.0%
shuffle placebo (50x): flagged adjusted 0.0%, unadjusted 0.0%
calibrated |t| > 1.96: plants that differ 0.0%; fresh shuffles (50x) flag 0.0%One run took 26 seconds on the test computer, with the data already downloaded (one measurement, 50 placebo repetitions). Two runs gave the same output.
The lines from effect on log(outcome) to the last ring have the same meaning as in the ERGIS documentation, section 6.2. "Per 100 MW older turbines" replaces "per parent". "Older turbines nearby vs none" replaces "child vs parent".
| GWR line | Meaning |
|---|---|
block-CV MSE by neighbours | Cross-validation error for each neighbour count. The smallest value selects the bandwidth. |
chosen | Selected neighbour count, median bandwidth in km, ENP and the adjusted critical |t|. |
local slopes | Median and 10th to 90th percentile of the local effects. |
plants that differ from the overall | Share of plants whose local effect differs from the overall effect, with the adjusted and the usual 1.96 limit. |
shuffle placebo | The same share after the residuals are moved to random plants. It shows the share that occurs by chance. |
Caution: the USGS link always gives the newest release, and EIA revises recent years. If you remove data/wind/, the next run can download different data and show different numbers.
Other wind runs:
uv run wind.py --radius-km 5
uv run wind.py --neighbours 100
uv run wind.py --years 2015 2023
uv run wind.py --geojson data/wind/wind.geojson
uv run wind.py --geojson docs/wind-app/data/wind-cv.geojson --geojson-forced 100 docs/wind-app/data/wind-k100.geojson
The run also writes the plants with a GWR fit forced to 100 neighbours. It uses the same DML estimate. Two lines show: wrote docs/wind-app/data/wind-cv.geojson: 781 plants and wrote docs/wind-app/data/wind-k100.geojson: 781 plants.python3 -m http.server -d docs 8000http://localhost:8000/wind-app/ in a browser. The online copy is wind-app/ on this site.Color plants by list: capacity factor, older capacity within 10 km, or local effect.GWR fit list. Selected by cross-validation shows the global slope. Forced local, k = 100 shows a local surface.Results to see the estimates, the rings, the cross-validation curve and the placebo.Caution: with the forced local fit, the colors show differences that cross-validation did not select. No plant differs from the overall effect with the adjusted α.
All values use USWTDB v9.1 and EIA-923 2011–2024, 781 study plants and 248 blocks. Effects are on log CF for each 100 MW of older turbine capacity within 10 km. Measured on 2026-11-30, after the code audit fixes.
| Estimate | Effect | Standard error | 95% interval |
|---|---|---|---|
| Naive OLS | −0.0086 | 0.0026 | −0.0137 to −0.0034 |
| DML PLR | −0.0012 (−0.12%) | 0.0039 | −0.0088 to +0.0064 |
| Naive difference, older turbines nearby vs none | +0.0239 | 0.0252 | −0.0255 to +0.0732 |
| DML IRM, older turbines nearby vs none | +0.0014 | 0.0215 | −0.0408 to +0.0435 |
Mean CF is 0.366. The out-of-fold R² is 0.48 for Y and 0.04 for D. The confounders barely predict D. The IRM clipped no propensities. The DML PLR value is the median of 10 cross-fitting splits, with the better of gradient boosting and additive splines for each prediction. Before 2026-11-30, with gradient boosting only and one split, it was −0.0071 (0.0029), and its interval excluded zero.
No variant shows a robust loss. Plants online 2015–2023 give −0.0072 (standard error 0.0031), but +0.0064 without the top 1% of D. Without the far West (longitude < −114.5°) the estimate is +0.0240 (0.0154). The earlier negative estimate depended on 8 plants at Tehachapi, California, with 1,433 to 2,542 MW of older turbines nearby, and on the lower capacity factors of the far West. The rings (0–5, 5–10, 10–20, 20–40 km) show no decrease with distance. The full report, section 5, gives all nine variants.
The block cross-validation selects one global slope. At a forced k = 100, no plant differs from the overall effect with the adjusted α. In the shuffle placebo, the analytic critical t marks 6.1% of plants by chance at k = 100. The run therefore calibrates the critical t from the placebo (4.23 at k = 100); a second placebo with new shuffles then marks 0.2%. The full report, section 6, gives the cross-validation errors and the placebo for each type of standard error.
The self-test checks build() on five hand-made plants, then recovers a synthetic east–west surface on the real plant positions. DML removes 66% of the naive bias in the self-test design. The full report, section 7, gives each check and its limit.
Caution: with approximately 780 plants, DML removes only 34% of the bias under the strongest synthetic confounding tested (18% to 24% with gradient boosting only; a Gaussian process reaches 37%). The target was 50%. The self-test limits were set after the first scan.
| Symptom | Cause | Fix |
|---|---|---|
wind.py: layout changed assertion | EIA moved the columns of Page 1 in a year file. | Examine row 6 of the file. Change the columns A, O, CR in fetch(). |
wind.py: download stops with a timeout | The server did not answer in 60 seconds. | Run the script again. It keeps the downloaded files and continues. |
wind.py: a turbine size is still unknown | A new USWTDB release has a turbine with no size and no turbine of known size within 2 years. | Examine the turbine in uswtdb.csv. Extend the window in load(). |
--rings must be positive and strictly increasing | The ring edges are not in increasing order. | Give the edges in increasing order, for example 5 10 20 40. |
--neighbours must be 0 (global) or 1 to … | The neighbour count is not less than the number of plants. | Use a smaller value. |
wind.py | The wind script: download, plant data, GWR, self-test. It imports the estimators from dml.py. | |
The web app shows Could not load the data | The GeoJSON files are not in docs/wind-app/data/, or the page was opened as a file. | Make the app data (section 6.2). Use the web server (section 6.3). |
| The web app shows no map | There is no access to js.arcgis.com. | Examine the internet connection. |
wind.py in the oil map, local_effects() in dml.py.| Path | Contents |
|---|---|
wind.py | The wind script: download, plant data, GWR, app data, self-test. It imports the estimators from dml.py. |
dml.py | The DML estimators: plr(), irm(), slope(), run(), run_rings(). |
data/wind/ | Downloaded data: uswtdb.csv, gen.csv, VERSION. Not in git. |
docs/wind-app/ | The web app and its data. |
WIND.md | The full wind report. |
DATASETS.md | Public datasets to test the method. |
docs/wind.html | This page. |
wind.py| Function | Input | Output |
|---|---|---|
fetch() | None | Downloads the data one time into data/wind/ |
load() | None | Turbines, plants and CF for each plant-year, as dictionaries of arrays |
build(turb, plants, cf, radius_km, years) | Output of load(). radius_km can be a list of ring edges. | Y, D, X, block numbers, longitude and latitude, row numbers of the study plants in the plant table |
bandwidth(dkm, k) | Distance matrix in km, neighbour count | Distance to the k-th nearest plant for each plant. k = 0 gives infinity. |
gwr(u, v, dkm, h, exclude) | Residuals, distances, bandwidths, pairs to leave out | Local slope, HC3 standard error, hat diagonal, fitted values |
local_gwr(u, v, ll, groups, alpha, k) | PLR residuals, positions, blocks | Dictionary: k, bandwidths, cross-validation errors, local effects, standard errors, ENP, critical |t|, overall effect |
placebo(u, v, g, reps, seed) | Residuals and the output of local_gwr() | Share of plants marked, with the adjusted α and with 1.96 |
write_geojson(path, ll, y, d, study, plants, g, meta) | Positions, Y, D, row numbers of the study plants, the plant table, output of local_gwr(), results | The app data file |
selftest() | None | Prints the results. Stops with an error if a check fails. |
Each file is a GeoJSON FeatureCollection in longitude and latitude. Each feature is one study plant.
| Property | Type | Meaning |
|---|---|---|
plant | integer | EIA plant id. |
name, state | text | USWTDB project name and state, the most frequent value over the turbines of the plant. |
year | integer | Online year. |
mw | number, MW | Plant capacity. |
cf | number, 0 to 1 | Capacity factor in the first full year. |
older_mw | number, MW | D × 100: older capacity within 10 km, averaged over the turbines of the plant. |
effect_pct, lo_pct, hi_pct | number, percent | Local GWR effect on CF for each 100 MW and its 95% interval. |
differs | 0 or 1 | 1 if the local effect differs from the overall effect with the adjusted α. |
The top-level member meta holds the data version, the run settings, the overall DML effect (theta, se, effect_pct, lo_pct, hi_pct), the rings, and gwr: neighbour count, selected_by (cv or forced), median bandwidth in km (null for the global fit), the cross-validation errors, ENP, the critical |t| and the placebo shares.
gwr().