made first order actually first order and added fourth order#120
Merged
pavelkomarov merged 19 commits intomasterfrom Jul 16, 2025
Merged
made first order actually first order and added fourth order#120pavelkomarov merged 19 commits intomasterfrom
pavelkomarov merged 19 commits intomasterfrom
Conversation
pavelkomarov
commented
Jul 1, 2025
| [(-25, -25), (0, 0), (0, 0), (1, 0)], | ||
| [(-25, -25), (-13, -13), (0, 0), (1, 1)], | ||
| [(-25, -25), (0, 0), (0, 0), (1, 1)], | ||
| [(-25, -25), (1, 0), (0, 0), (1, 1)], |
Collaborator
Author
There was a problem hiding this comment.
The first order bounds only get a touch worse when we make first_order truly first order.
pavelkomarov
commented
Jul 1, 2025
pynumdiff/tests/test_diff_methods.py
Outdated
| [(1, 0), (1, 0), (1, 1), (1, 1)], | ||
| [(1, 0), (1, 1), (1, 0), (1, 1)], | ||
| [(2, 2), (3, 2), (2, 2), (3, 2)], | ||
| [(2, 2), (3, 3), (2, 2), (3, 3)]], |
Collaborator
Author
There was a problem hiding this comment.
The "iterated_first_order" bounds get worse all over the place, because the horizontal bias introduced by a non symmetric first-order method causes drift over the iterations.
Collaborator
Author
|
The |
Merged
Collaborator
Author
|
Let's merge this one after #125. I think I'm going to want to make a couple follow-on commits to it. I need to:
|
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.
Addressing #104. The resulting
first_orderis biased to one side, resulting in drift when it's iterated:This is likely why you attempted some forward-backward averaging, @florisvb.
Honestly, is it worth keeping around
first_order? My guess is it's not in wide usage, because the higher order methods are equally usable and right there for the taking. Iteratingfirst_ordermight be a thing people do, but in that case they're actually iteratingsecond_order, so we should update the code to reflect that and feed them a warning if they try to callfirst_order.