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

Fitting in semi-log vs log-log #215

Closed
ryanhammonds opened this issue Aug 4, 2021 · 1 comment
Closed

Fitting in semi-log vs log-log #215

ryanhammonds opened this issue Aug 4, 2021 · 1 comment

Comments

@ryanhammonds
Copy link
Contributor

ryanhammonds commented Aug 4, 2021

I started to look into fitting in semi-log vs log-log and noticed that gaussians in semi-log are skewed gaussians in log-log and vice versa. I know there has been interest in adding skewed gaussians that we planned for post specparam release. I realized this would require a lot of updates in #195.

However, adding a parameter in the fit method allowing curve_fit to operate on either freqs or np.log10(freqs) may simply things and be an easier update if we want to add skewed gaussians. What do you think @TomDonoghue?

import matplotlib.pyplot as plt
import numpy as np
from fooof.core.funcs import gaussian_function

freqs = np.arange(1, 100)

ys = gaussian_function(np.log10(freqs), *[np.log10(20), 5, np.log10(1.5)]) 

plt.plot(np.log10(freqs), ys))

log_gaussian

# skewed in semi-log
plt.plot(freqs, ys)

log_gaussian_in_linear

@ryanhammonds
Copy link
Contributor Author

Nevermind, this would only allow skews in one-direction. Whoops

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

1 participant