use function of derivative rather than differentiate#604
Merged
Conversation
xchourio
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was meant to fix the problem with different physical values in the local distributions, but given the seemingly lack of concern from the Climate Group on the matter during the meeting, I'll just push what I've done here and we'll get back to it with another PR when they provide some inputs on what to do next.
pdf is the derivative of cdf. I originally computed it by using differentiate function against cdf data. But the function to calculate the cdf is a combination of exp so it's also trivial to calculate on paper the derivative function, and then use that function instead. That's what I am doing now and ELR_poe returns both cdf and pdf. I obtained the same results using either way.
ELR_pdf is no more used. I also tried different ways to calculate it this way when exploring problems. I also like better the new way so I kept it and kept the ELR_pdf function for the record. Keeping its old way commented for the record as well.
The change in ELR_quantity is actually not a change : log(a/b) = log(a) - log(b). I didn't realize that right away when I made the change looking for errors. I like better the new version so I kept it. Obviously it doesn't change the results.