Message Boards Message Boards

0
|
348 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
Posted 7 days ago

Thanks for posting the code and data. You'll think I'm never satisfied but your code is just too long and complicated for me to follow. If you can, posting a minimal working example is what is needed.

For example, to import the data, shift the horizontal values in increments of 30, and plotting the result can be done in far fewer steps:

d = ConstantArray[0, 8];
Do[d[[i]] = Import["data" <> ToString[i] <> " " <> ToString[i] <> "0 Torr.CSV"];
  d[[i, All, 1]] = d[[i, All, 1]] + 30 (i - 1), {i, 1, 8}]
ListPlot[Flatten[d, 1], Joined -> True, PlotRange -> All]
POSTED BY: Drjbaldwin
Posted 8 days ago

In my previous reply I uploaded 4 datasets, here I uploaded other 4 datasets.

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