-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definitive fix of negative uncertainties from linear extrapolation #446
Conversation
…_method='linear' in interp_nd_binning (GlacioHack#380)
…ev, which is passed on to curve_fit
Amazing, thanks @MatteaE! I had to trigger the test workflows (because it's your first time contributing, then it does it automatically): All tests passing 😄! (except a Windows one that fails due to different random sampling between OSs from a recent PR, but I'll fix that separately) We should add a check related to your PR in |
Cool, thanks a lot @rhugonnet! |
Mmhh.. introducing a new dataset through xdem-data is quite a bit of work. Maybe a solution in this case would be to simply copy the binning dataframe you had with your real data that triggered the issue in interp_nd_binning directly. This should only be a couple lines of real values to write in the code (and could potentially help us craft an artificial example if we understand the pattern that triggered the issue). |
Ok good point, here is the binning data frame which triggers the error - let me know if it is enough! |
Thanks! I also need the locations where it gets negative, I couldn't find it by searching around: import xdem
import pandas as pd
fn_csv = "/home/atom/downloads/df_negative_err.csv"
df = pd.read_csv(fn_csv)
fn = xdem.spatialstats.interp_nd_binning(df, list_var_names=["slope", "maxc"])
print(fn((0, 0)))
print(fn((48, 2)))
print(fn((100, 50)))
print(fn((100, 0)))
print(fn((0, 50)))
|
Here it is, sorted from most to least negative: df_neg_sorted.csv
(Probably a different value of min_count produces a different dh_err_fun and the locations would also change) |
Using your data I managed to reproduce the error in an artificial data example, and added it to the tests. Was also the occasion to look at the behaviour in 2/3D, and the fix looks durable. Thanks a lot! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All passing, merging! Thanks again @MatteaE
interp_nd_binning
problematic for error analysis #380,EDIT by @rhugonnet:
pd.Dataframe
containingpd.Interval
written as strings.