Message Boards Message Boards

0
|
350 Views
|
6 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Speeding up the fitting of a model with 23 parameters using NonLinearModelfit

Posted 11 days ago

I have an experimental dataset. Data points are of the type {w,y} where w is the frequency and y is experimental absorbance. I want to fit this data with a spectroscopic line profile using NonLinearModelfit function in Mathematica. Size of data is about 500 points and the number of parameters to be fitted around 23-28. It is taking lot of time around 7-8 hours. I cannot divide my dataset and compute parallelly because in that case there will be no consistency of the fitted parameters across the divided datasets. Then how to faster the process? Any suggestions?

POSTED BY: Rajesh Chell
6 Replies

Rajesh,

What is the form of your equation that you are trying to fit?

POSTED BY: Neil Singer
Posted 9 days ago

It's not easy to help without seeing the data, some of the functions (unperturbedFrequency, etalon, background, and areaFunc), and numerous constants (shift, crossoverFrequency, paramstobefitted, Areaparamstobefitted, BGparamstobefitted, and etalonParamstobefitted).

I understand that you need consistency among the subsets of the data but first fitting those subsets separately might help get starting values for the fitting of the complete set of data.

Also, when you do arrive at a result, you need to look at the parameter correlation matrix which you can find with myFit["CorrelationMatrix"]//MatrixForm. With that many parameters it will not be surprising if some of the correlations are very near -1 and +1 which indicates overparameterization.

POSTED BY: Drjbaldwin
Posted 9 days ago

Please find the attached notebook (the part of my code). Here my fitted function is complete profile and the fitted parameters (in the form of list) are- paramstobefitted, Areaparamstobefitted, BGparamstobefitted, etalonParamstobefitted . These are parameter lists in the form they appear in profile function. This code works well but taking lots of time. Can you please help??

POSTED BY: Rajesh Chell
Posted 8 days ago

Hii , I have uploaded the full code and 8 data files. Please find them.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract

Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use