Skip to content
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

ENH: Stop unstable lowess iterations #9220

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jseabold
Copy link
Member

I was running into some issues trying to interpolate between a lot of 0s and 1s similar to some of the old test cases and issues. I noticed that R just bails out if the MAD gets close to zero "since the algorithm is highly unstable in that case." This seems to close a few of the open lowess issue and (partially) fix the one I was having.

I removed one of the test cases that is no longer the behavior. I guess technically this is a breaking change, but the new behavior now matches R.

This partially fixes #7337, if you consider extrapolating a good fix. Only the frac=.3 test case spits out NaNs now. I'll have to go through that part, but that's probably for a different PR.

# std_resid[std_resid >= 0.999] = 1.0
# std_resid[std_resid <= 0.001] = 0.0

return bisquare(std_resid)
Copy link
Member Author

Choose a reason for hiding this comment

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

I just copy-pasted this into the loops, so I could check the median and break. There are other ways to do this...

@jseabold
Copy link
Member Author

Test failures look unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant