Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Curve fitting problem
Date: Wed, 17 Dec 2008 01:05:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gi9j84$miq$1@fred.mathworks.com>
References: <gi6gvi$jlc$1@fred.mathworks.com> <gi7tie$jau$1@fred.mathworks.com> <gi91ji$b7a$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229475908 23130 172.30.248.35 (17 Dec 2008 01:05:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Dec 2008 01:05:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:507419


"Tazmusica " <tazmusica2@deletethis.gmail.com> wrote in message <gi91ji$b7a$1@fred.mathworks.com>...
> Roger,
> Thank you for the suggestion. I can see that the Lorentzian is linear in the a and vshift terms, and I see that this reduces the number of parameters that fminsearch has to deal with. So if the function of Lorentzians were called L(x), and each lorentzian in the sum were l(x), then L(x)=a1*l1(x)+a2*l2(x)+a3*l3(x)+vshift. What I am unclear on is how to rewrite the function to always achieve the minimum of the a and vshift values. I can see where it should be the solution to a system of linear equations that would automatically minimize the a and vshift values, but I guess I am not seeing how I can get this into a form that I can pass to fminsearch using only the remaining 6 parameters. I apologize for being so obtuse, and I thank you for all of your help.

  Fortunately John has come to the rescue with his 'fminspleas'.  I was either unaware of, or had long since forgotten, its presence in the File Exchange, but happily that saves me a lot of work explaining how to carry out this procedure.  Hopefully my earlier remarks should at least give you an idea of the theory behind 'fminpleas' action.

  As you can probably surmise, if the number of Lorentzians were to get up to or past five with two parameters each, you may still encounter the sort of difficulties you have experienced, even using 'fminpleas'.  Sending a large number (like ten) of nonlinear parameters to fminsearch may still make life difficult for it in converging to a successful solution.

  A lot could depend on the accuracy of your initial estimate in getting the iteration process off to a good start and with ten parameters that could be tricky.  I would suggest playing around with the plot function in arriving at rough curve fits to assist in arriving at such estimates.

Roger Stafford