
fitiing with integrals

diegoc
hello, i need to fit a data set to the integral of a gaussian (which looks like a sigmoid) but for biological reasons, the fitting parameters are those of the gaussian. I don't know how to use either integrate1D or integrate in a FuncFit (user defined fitting function). Does anyone have an example of doing such things?
thanks a million
diego
I think you can simply use the function StatsNormalCDF instead of doing the integration within the fit function.
e.g.:
EDIT - I have updated the code to explicitly make the test data using integrate, and added height and offset to the fit.
November 17, 2023 at 09:37 am - Permalink
If you are going to do integration over an internal variable rather than the independent variable, this forum topic might help:
How to do integration over an internal variable in fitfunc? | Igor Pro by WaveMetrics
November 18, 2023 at 03:53 pm - Permalink
But since there is a well-known analytic integral for a Gaussian, use that instead. In fact, that will be available in either the StatsNormalCDF() function, or the erfc() function. Naturally, you will need to figure out how to transform the result to account for parameters you use in the Gaussian function.
November 20, 2023 at 11:03 am - Permalink
Here is an example of two functions I have used for fitting XPS peaks as a Gaussian peak with a Shirley background, which is the integral of the peak, calculated using erf().
November 20, 2023 at 12:34 pm - Permalink
i am very thankful to your answers, the fit_normalCDF does work but i still think i need to integrate a gaussian. i apologize for my poor coding skills, is there a flagrant error in this code? its trying to fit all at once. again i apologize if what i am writing is absurd.
November 23, 2023 at 10:30 am - Permalink