[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[leasqr] simple fit does not converge
From: 
John W. Eaton 
Subject: 
[leasqr] simple fit does not converge 
Date: 
Tue, 25 Jan 2011 18:12:52 0500 
On 25Jan2011, Martijn wrote:
 I am fitting a dispersion function (the Sellmeier equation) to
 tablulated refractive index data but leasqr.m does not converge. I am
 able to fit e.g. a sine to a data set, so leasqr does work.

 After reduction to the bare essentials my code looks like:


 E=0.5:.05:6;
 E=E(:);
 Ntab = sqrt(GetSopraDielFunc(E, 'bk7'));
 f = @(E, p) sqrt(1+p(1)./(1p(2)*E.^2/1.54));
 p0 = [1.25, .011];
 [Nslm, p, convg, niter] = leasqr(E, Ntab, p0, f);
 plot(E, [Ntab, Nslm], 'linewidth', 2)

 The strange thing is that not only the covergence is not achieved, but p
 does not differ from p0, indicating something is going really wrong.

 The initial estimate is pretty good as can be seen by
 plot(E, Ntab, E, f(E, [1.25, 0.011])

 What's wrong here? Is it possible to show the intermediate values of p?
 Where is leasqrdemo gone? If I remember correctly, it did show the
 intermediate parameter values.
What is GetSopraDielFunc?
If you have a bug to report, please use the bug tracker. You can find
a link to the tracker at http://www.octave.org/bugs.html along with
other information about how to submit a useful report.
jwe