Skip to content

Bugfix: harmonize historical smoothed drivers (GDP, Pop) across scenarios - #63

Open
bennet21 wants to merge 8 commits into
pik-piam:mainfrom
bennet21:development/correct-smoothing
Open

Bugfix: harmonize historical smoothed drivers (GDP, Pop) across scenarios#63
bennet21 wants to merge 8 commits into
pik-piam:mainfrom
bennet21:development/correct-smoothing

Conversation

@bennet21

@bennet21 bennet21 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

For improved model results, driver data (GDP, Pop, Floorspace) is smoothed. Previously, historical and future data was smoothed together. This leads to slightly different historical driver values across scenarios, which is not desired.

This PR fixes this with a new smoothing function: toolHistoricallyConsistentSmoothing. It smoothes every scenario independently. Then, historical data for non reference scenarios (by default any scenario other than SSP2) is replaced by the historical smoothed data from the reference scenario (SSP2). Because this might lead to discontinuities on the historical/future interface in non reference scenarios a smooth transition between smoothed reference and smoothed future scenario is applied.

The new tool function is tested separately. Let me know if this is good practice of if we prefer it differently.

@bennet21
bennet21 marked this pull request as ready for review July 5, 2026 08:59
Comment thread tests/testthat/test-toolHistoricallyConsistentSmoothing.R
Comment thread R/toolHistoricallyConsistentSmoothing.R
Comment thread tests/testthat/test-toolHistoricallyConsistentSmoothing.R
Comment thread R/toolHistoricallyConsistentSmoothing.R Outdated
Comment thread R/toolHistoricallyConsistentSmoothing.R Outdated
Comment thread R/toolHistoricallyConsistentSmoothing.R Outdated
Comment thread R/toolHistoricallyConsistentSmoothing.R
Comment thread R/toolHistoricallyConsistentSmoothing.R Outdated
Comment thread R/toolHistoricallyConsistentSmoothing.R Outdated
Comment thread R/toolHistoricallyConsistentSmoothing.R Outdated
@bennet21
bennet21 requested a review from fbenke-pik July 10, 2026 15:07

@fbenke-pik fbenke-pik 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.

Thank you! Everything looks good to me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants