Connect with users of Wolfram technologies to learn, solve problems and share ideas
Mark as an Answer
1 Total Likes
Follow this post
Share this post:
NonlinearModelFit screws up the fit when facing constraints
11 years ago
I am using a model of several gaussians to fit infrared absorption data. For this purpose, I define the resonances I expect at certain wavenumbers (i.e. the wavelength) using "NormalDistribution" and then use the sum of them as my model.
To find starting values, I use an interactive "Manipulate" environment which is working nicely. Using these, Mathematica finds the fit requested rather quick. Some of the parameters are running to values which are not physical. Therefore, I wanted to restrict these parameters using the constraints as described in the Documentation. As soon as I have a constraint on a single parameter, Mathematica takes much longer to compute a fit and the output is much worse or even absolutely stupid (meaning there is no "fit" at all!).
This behaviour I do not understand and would like to know how I can circumvent this situation (either using a different function than "NonlinearModelFit" or some other options.
Any opinion on this is welcome!
PS: I am working on a short example for you guys. I will provide it as soon as possible.
Udo Krause, NOrganization
11 years ago
Have a look there for an earlier problem of the same kind
basically one has to restrict the parameters to an area where
the solution lies
no singularities of the model take place
NonlinearModelFit can't resist a singularity of the model because of it's usage of the Marquardt-Levenberg-Algorithm as one of its algorithms.
Reply to this discussion
in reply to
Community posts can be styled and formatted using the
Tag limit exceeded
Note: Only the first five people you tag will receive an email notification; the other tagged names will appear as links to their profiles.
Add a file to this post
Follow this discussion
Be respectful. Review our
to understand your role and responsibilities.
Wolfram|Alpha Notebook Edition
Volume & Site Licensing
Enterprise Private Cloud
Service Plans Benefits
Wolfram Language Documentation
Wolfram Language Introductory Book
Get Started with Wolfram
Fast Introduction for Programmers
Fast Introduction for Math Students
Webinars & Training
Connected Devices Project
Wolfram Data Drop
Wolfram + Raspberry Pi
. All rights reserved.
Learn how »