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

statistical test to determine peak significance #124

Closed
rdgao opened this issue Feb 5, 2019 · 4 comments
Closed

statistical test to determine peak significance #124

rdgao opened this issue Feb 5, 2019 · 4 comments

Comments

@rdgao
Copy link
Contributor

rdgao commented Feb 5, 2019

Currently, peaks are identified based on a combination of user-defined threshold and comparison to the residual variance of the PSD after peak fitting.

One possible way to make this more theoretically grounded in stats is suggested here: https://atmos.washington.edu/~dennis/552_Notes_6b.pdf
pg 167: statistical significance of spectral peaks

Essentially, it compares the peak height to a theoretical null determined under the model of colored noise, which has a exponential power distribution at that frequency. Given the number of windows used to compute the PSD (degrees of freedom), one can compute a p-value under a pre-defined alpha to determine how likely the detected "peak" occurred by chance.

Since fooof is fitting an aperiodic component already, that would be the power under the null model which we would compare against.

Note that this will require additional inputs, namely, number of windows the user averaged over to compute the PSD (if using Welch's method).

@parenthetical-e
Copy link

parenthetical-e commented Feb 5, 2019 via email

@rdgao
Copy link
Contributor Author

rdgao commented Feb 5, 2019

I agree with this 90% of the way, and the one integrated use case I can think of is to let the significance drive peak detection, i.e. iteratively toss out insignificant peaks and refit slope, though I'm not sure how you would then limit the fitting such that it doesn't find the same peak again.

@parenthetical-e
Copy link

parenthetical-e commented Feb 5, 2019 via email

@TomDonoghue
Copy link
Member

Following #154, this has been moved to:
fooof-tools/Development#5

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

No branches or pull requests

3 participants