Skip to content

Add downscaling-error diagnostic (OOB RMSE vs ensemble spread) - #4070

Merged
mdietze merged 3 commits into
PecanProject:developfrom
Tejas7007:GH-ilamb-downscaling-error
Sep 16, 2026
Merged

mdietze merged 3 commits into
PecanProject:developfrom
Tejas7007:GH-ilamb-downscaling-error

Conversation

@Tejas7007

Copy link
Copy Markdown
Contributor

Description

Adds a small diagnostic that compares the downscaling model's own predictive error against the spread of the SDA ensemble, at the assimilation sites, in each variable's own units.

Each SDA ensemble member is downscaled to a 1 km grid by its own random forest. This reads the saved per-member forests and reports, per variable and year, the between-member spread (standard deviation across members, averaged over sites), the downscaling out-of-bag RMSE (averaged over members), and their ratio. When the OOB RMSE exceeds the spread, the members agree with each other more tightly than the downscaling is actually accurate, so the downscaled maps carry error the ensemble spread does not represent. This complements the ensemble-calibration and regional diagnostics already in this directory.

Contents (in modules/benchmark/inst/ilamb/calibration/):

  • downscaling_error.R computes the OOB RMSE, the between-member spread, and the ratio from the saved per-member randomForest objects. Paths are parameterized (--model-dir, --variables, --year); the defaults are illustrative.
  • test_downscaling_error.R builds small synthetic randomForest objects and checks the extraction, the ratio, and the error paths.
  • README_downscaling_error.md documents the inputs, how to run it, and the language choice.

Note on language: the other diagnostics in this directory are Python; this one is R because the downscaling models are R randomForest objects saved in .Rdata, which R reads natively.

Motivation and Context

The ensemble-calibration work showed the ensemble is overconfident relative to independent benchmarks. One contributing mechanism is the downscaling step: the random forest emulator shares structure across members, so the members can agree closely while all being similarly off from truth. This diagnostic makes that quantitative by putting the downscaling's own error next to the between-member spread.

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Compare the downscaling random forest's out-of-bag RMSE against the
between-member ensemble spread at the SDA sites, quantifying downscaling
error the ensemble spread does not represent. R script plus test and README.

@ankurdesai ankurdesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good - math makes sense to me

@mdietze
mdietze enabled auto-merge August 24, 2026 23:33
@mdietze
mdietze added this pull request to the merge queue Sep 16, 2026
Merged via the queue into PecanProject:develop with commit fdd7273 Sep 16, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants