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

[WIP] Flexible fit functions #195

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

[WIP] Flexible fit functions #195

wants to merge 3 commits into from

Conversation

ryanhammonds
Copy link
Contributor

@ryanhammonds ryanhammonds commented Feb 20, 2021

This addresses a point in #193 - to increase the flexibility of aperiodic and periodic fit funcs by allowing custom functions and to expand the available functions.

The fit funcs are defined by fm.aperiodic_mode and fm.periodic_mode when a the fit object is initialized. The periodic modes will be expanded to accept skewed_gaussianand double_exponential (to-do). In addition to strings, custom funcs will be passable (i.e. FOOOF(periodic_mode=custom_func)).

There is still a lot to do here, specially updating _fit_peaks and _fit_peak_guess, since they both expect the 3 parameter gaussian function. There are a lot of other places where the 3 parameters periodic mode will need to be updated (control+f '3' to see all the places where the 3 param mode is expected). Variable name with gaussian or gauss should also be updated to something like periodic to generalize.

@ryanhammonds
Copy link
Contributor Author

ryanhammonds commented Mar 4, 2021

cfa8a2b adds skewed_gaussian_function. It takes the same parameters as gaussian_function, with an additional alpha parameter to control the skew. This implementation multiplies the normal gaussian by a skewed cumulative distribution function. A different solution may better allow setting the center and width of the skewed result.

skew

@TomDonoghue TomDonoghue added 2.0 Targetted for the specparam 2.0 release. >2.0 Idea for beyond specparam 2.0. and removed 2.0 Targetted for the specparam 2.0 release. labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>2.0 Idea for beyond specparam 2.0.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants