fooof icon indicating copy to clipboard operation
fooof copied to clipboard

Q: Gaussian error-bar

Open reihanehk opened this issue 3 years ago • 2 comments

Dear all,

I want to check the goodness of fitting of each Gaussian fit separately (for example, if a dataset has 4 peaks, I need 4 error bars). I can use pointwise_error and then extract the error of CF from it, but surely it is not sufficient. I need to have the error-bar of each Gaussian fit, not just a point. Is it possible to have it?

Bests, Reihaneh

reihanehk avatar May 04 '22 07:05 reihanehk

Hey Reihaneh - do you mean you want to compute an error that is specifically the pointwise difference between the model and each individual gaussian? This should generally be possible - you can, for example, pull each peak definition, and then pull the data around a range of something like +/- the peak width, and then compute the difference error.

However, this could be tricky to interpret, largely to do with overlapping peaks. Sometimes, in the real data, an overall peak is captured by two gaussians. In this case, each individual gaussian would probably have high error in this "peak by peak" metric, but might still be a good combined fit to the data. I'm not sure if there is an easy way to address this.

TomDonoghue avatar May 04 '22 14:05 TomDonoghue

Dear Tom, Thanks for the reply. You are right. About the overlapping Gaussian, I was thinking of using the fit closer to the data to find the difference.

Do you offer any other method to calculate the error of Gaussian fit (Or CF) (not necessary pointwise difference)?

reihanehk avatar May 05 '22 08:05 reihanehk

Hey @reihanehk - sorry for dropping off on this thread.

In this toolbox, we don't have anything available to compute the error per peak, and as mentioned above, due to the overlapping peaks, I don't really know how this would be best addressed.

Perhaps of interest is the error metrics that can be computed across frequencies: https://fooof-tools.github.io/fooof/auto_examples/manage/plot_freq_by_freq_error.html

If you figured out a strategy for addressing this question, I'd be curious to hear about it!

TomDonoghue avatar Jun 29 '23 19:06 TomDonoghue

Since there is not a practical to do here (at least for now), I'm going to close this.

Note that this question is related to a broader development idea that is listed and discussed here: https://github.com/fooof-tools/Development/issues/5

TomDonoghue avatar Jul 17 '23 20:07 TomDonoghue