Skip to content

Diagnostic Reports

A diagnostic report is generated for each sector/subsector. It evaluates how well the fitted polynomials represent the underlying simulation data, following the evaluation framework described in the methodology.

Parameter distributions

Eight-panel histogram showing the distribution of each estimated parameter across all regions. For gamma, the histogram is generated by sampling from the estimated \(N(\hat{\gamma}, SE)\) distribution (matching the R reference approach). For all other parameters, the histogram shows the values across regions at the median gamma quantile.

What to look for: the shape of the distributions indicates how much heterogeneity exists across regions. A wide alpha distribution means regions differ substantially in their linear temperature response. Beta concentrated near zero suggests the constraint binds frequently.

Polynomial summary

Evaluates the fitted quadratic \(D(T) = \alpha T + \beta T^2\) across all regions:

  • Zero crossings: At what temperature does the polynomial change sign? Computed as \(T^* = -\alpha / \beta\). Regions where \(\beta = 0\) (constraint binds) have no crossing. Regions with \(T^* > 20\) or \(T^* < 0\) are outside the relevant temperature range.

  • Slope distribution: The maximum slope of the polynomial between 0 and 10 C, computed as \(\max(|\alpha|, |\alpha + 20\beta|)\). Extreme slopes suggest regions where small temperature changes produce large impact changes.

  • Convexity: Fraction of regions where the unconstrained estimate would have had \(\beta > 0\) (and was therefore clipped). For agriculture with the \(\beta \leq 0\) constraint, this indicates how often the constraint binds.

Damage curves

Spaghetti plot of sampled regional polynomials, with the cross-region mean and interquartile range overlaid. Plotted from 0 to 8 C temperature anomaly.

The spread of curves indicates the range of regional responses. The mean curve shows the "typical" damage function shape. Wide IQR bands suggest substantial regional heterogeneity.

Flex vs raw comparison

The core validation: does the fitted polynomial, evaluated with scenario-specific temperature and income, reproduce the raw simulation data?

For each scenario (RCP \(\times\) SSP \(\times\) period):

\[\hat{D}_i = (\alpha_i \bar{T} + \beta_i \bar{T}^2) \cdot \bar{Y}_i^{\gamma}\]

is compared to the raw simulation mean \(\bar{N}_i\) for that region and scenario.

Diagnostics reported per scenario:

  • Correlation: Pearson correlation between flex and raw across regions. Values above 0.95 indicate the polynomial captures the spatial pattern well.

  • RMSE: Root mean squared error. Scale depends on the outcome variable units.

  • Sign agreement: Fraction of regions where flex and raw have the same sign. Sign disagreement means the polynomial predicts benefit where the simulation shows damage (or vice versa).

  • Maps: Four maps per scenario showing the spatial distribution of flex predictions, raw means, their difference, and sign agreement. Red indicates damage or overprediction; blue indicates benefit or underprediction.

  • Worst predictions: The 10 regions with the largest absolute residual between flex and raw.

Results are organized by period (2080-2099, 2060-2079) with tabs for each RCP/SSP combination.

Generating reports

python scripts/generate_report.py --sector agriculture --subsector corn \
    --results-dir /path/to/parameters \
    --format html

Reports are self-contained HTML files. Each report covers one sector/subsector combination.

Available reports

All reports are hosted at c1587s.github.io/flex-damage-reports. Each subsector name below is a direct link to its report. Empty cells indicate combinations that are not produced.

Resolution Agriculture Mortality Labor Energy
Impact region Cassava · Corn · Rice · Sorghum · Soy · Wheat (combined) · Wheat (spring) · Wheat (winter) All-cause all-age Combined · High-risk · Low-risk Total · Electricity · Non-electricity
Country Cassava · Corn · Rice · Sorghum · Soy · Wheat (combined) · Wheat (spring) · Wheat (winter) All-cause all-age Combined · High-risk · Low-risk Total · Electricity · Non-electricity
Country (unconstrained) Total · Electricity · Non-electricity

The unconstrained column only applies to energy: those reports drop the \(\beta \geq 0\) convexity constraint. Compare them against the standard country reports to see where the constraint binds (\(\beta = 0\) in the constrained run, \(\beta\) non-zero in the unconstrained run). For non-electricity in particular the unconstrained fit gives more regions concave \(\beta\) values, but tropical countries' positive raw signal is still not recovered. That is a structural limit of the flex form against pop-weighted country data, not a constraint problem.

Each report is a self-contained HTML file with interactive plots, country maps, and scenario comparisons.