boyac / pyArchive

Data structures, algorithms, object oriented programming, Python data processing, predictive models, regression analysis, blockchain etc
1 stars 1 forks source link

Using scipy's genetic algorithm for initial parameter estimation in non-linear regression #4

Open zunzun opened 7 years ago

zunzun commented 7 years ago

I see you are writing regression code using Python. Scipy has solvers for non-linear equations, however scipy's default initial parameter values are all 1.0. This can be suboptimal, and in more complex equations often results in the algorithms finding a local minimum in error space. For this reason, the authors of scipy added a genetic algorithm for initial parameter estimation. The module is named scipy.optimize.differential_evolution.

I have used scipy's Differential Evolution genetic algorithm to determine initial parameters for fitting a double Lorentzian peak equation to Raman spectroscopy data of carbon nanotubes and found that the results were excellent. The GitHub project, with a test spectroscopy data file, is:

https://github.com/zunzun/RamanSpectroscopyFit

My background is in nuclear engineering and industrial radiation physics, and I love Python, so if you have any questions please let me know.

James Phillips

boyac commented 7 years ago

@zunzun Thanks a lot!