pjabardo / CurveFit.jl

Simple least squares and curve fitting functions
Other
77 stars 14 forks source link

Curve Fitting with Gaussian or other similar functions #34

Open yu-ting-py opened 1 year ago

yu-ting-py commented 1 year ago

Thanks for your effort in developing curve fitting in Julia. I am using Julia v1.8 and trying to fit data with Gaussian, Lorentzian, and Voigt functions.

Is it possible to write user-defined functions and run fitting?

pjabardo commented 1 year ago

Probably. This package is basically a few curve fits that I use in my daily work. If you give me the exact functions I can try to do something.

I could try to write something. Probably the basic machinery is implemented. I know the Gaussian function but not the Lorentzian or Voigt functions.

The Gaussian function would involve nonlinear curve fitting and the trick is to get the best initial guess for the parameters a, b, and c:

y = a * exp( -(x-b)^2/2c^2 )

But I don't see many problems.