-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
add estimate_sigma function to threshold features #395
Open
micha2718l
wants to merge
22
commits into
PyWavelets:main
Choose a base branch
from
micha2718l:threshold_alpha
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
48e6006
first commit to ensure tool chain correct
micha2718l f018bd3
Naive copy-paste estimate_sigma ripped out of scikit.
micha2718l 3cb502e
Removed image functions. Changed test and example. Comments to match.
micha2718l 25fab87
Removed temp and vs code files.
micha2718l 65ce36c
Fixed variables in estimate_sigma input.
micha2718l 1e53ece
Fixed PEP8 violations.
micha2718l 484856b
Remove print from example in doc to get travis to pass 2.7 build.
micha2718l 407985b
Added ability to pass in object with ppf method.
micha2718l 557738b
Merge branch 'master' into threshold_alpha
micha2718l 602ceb0
Merge https://github.com/PyWavelets/pywt into threshold_alpha
micha2718l 7dab21a
Remove old tests for threshold.
micha2718l bc8b1d5
Merge branch 'PyWavelets-master' into threshold_alpha
micha2718l ed1d9ff
Fixed test wavelet leftover.
micha2718l e2aa85b
Merge pull request #2 from PyWavelets/master
micha2718l 11282da
Add estimate_sigma to docs.
606fae6
Remove debug wavelet name.
0ba3996
Fixing docstring formatting.
644a1c5
Add tests for estimate_sigma
1f5beee
change estimate_sigma to estimate_noise
1f284f5
Merge remote-tracking branch 'upstream/master' into threshold_alpha
73fa511
Merge branch 'master' into threshold_alpha
micha2718l 1c2a6ea
removing auto files
micha2718l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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.
In addition to a string name, you could accept any object with a
ppf
method here perhaps (assuming that works, didn't read the paper)? Just check withif hasattr(distribution, 'ppf')
.The bigger issue here seems to be the hardcoding of the 75th quantile. Why is that not a keyword?
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.
It seems like both choices originate from specific suggestions by the author, I agree that the best solution would be to have any distribution or quantile as valid inputs, as that could prove useful. The issue I saw is the use of scipy.stats in the original code, because PyWavelets doesn't rely on scipy (right?) I'm not sure what the best thing to do there is, including scipy for just this is overkill, perhaps a couple hand coded options for now? Or for just Gaussian with a variable percent input, shouldn't be too hard to get going without scipy.
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.
Btw, nice suggestion for finding if a distribution supports a method, seeing the example it seems obvious now.
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.
Indeed we don't want to rely on
scipy
. That's why I suggested checking for appf
method; users can still pass inscipy.stats
distributions but we don't need to import from scipy anywhere so we don't rely on scipy.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.
A concise explanation of the rationale for use of the 75th quantile in MAD is given on the following wikipedia page:
https://en.wikipedia.org/wiki/Median_absolute_deviation
Perhaps it is worth adding that to the References? I don't remember if it was spelled out explicitly in Donoho's paper
I also agree about not relying on
scipy
here.scipy
was already a dependency ofscikit-image
and a reviewer of my PR there preferred to call theppf
method explicitly instead of hard-coding the value, but that doesn't mean we have to do the same here.The idea to check for a
ppf
method is nice.Another approach to deal with other noise distributions such as Poisson noise is to first apply a variance stabilizing transform prior to calling this Gaussian-based MAD method. An example implementation of this type of approach for use with Rician noise is available here, but it is not under compatible license terms.