Skip to content

Fitting in semi-log vs log-log #215

@ryanhammonds

Description

@ryanhammonds

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions