[phoenix-project] Re: Expeyes-Junior diode fit fails for LED

  • From: ab <abals@xxxxxxxxxxxxx>
  • To: Ambar Chatterjee <drambar@xxxxxxxxx>, ab <abals@xxxxxxxxxxxxx>
  • Date: Sat, 14 Jan 2017 17:49:43 +0100

Good comment, thanks!

I had similar concerns after I sent the mail (at least my statement was wrong that the knowledge of the function -- a exp(b x) -- would not be used by the non linear fit), but you gave some more reasonable statements.

I run several tests with Levenberg-Marquardt and exponential fits. If the start values are not close the (absolute?) minimum the algorithm stops after some time without convincing results. Scipy leastsq reports somethink like "maxfev =800" achieved and terminates.

What I'll do is to check the "amateur" approach of a log(y) linear least square fit and see whether my parameters are better than the Levenberg fit.

Following observations are remarkable:

* I did not find any theoretical description of characteristic curves for LED.
* The LED curves measured by Expeyes fit very well if "emission values" larger than 2 are allowed; ie two values (i, n) give a very good approximation of the observed curve.
* Perhaps the "emission coefficient" describes not only the recombination but photon emission as well.
* Then there should be a (theoretical) dependence of n and bandwidth (color) of LED.
* Levenberg-Marquardt fit fails to find the right parameters if the start value for n is between 1 and 2. Perhaps there are too many small local extrema. But I would be surprised if we were the first who found out the limitation for exponential fits.

Best regards
Andreas



On 14.01.2017 04:24, Ambar Chatterjee wrote:

*I am commenting on:*
/I think I found the problem:
It is the fitting algorithm "leastsq" which is a "Levenberg-Marquardt"
fit, ie least square fit.
It does not take advantage of the knowledge that the funktion is
exponential.
Instead it sees huge values for large x and tiny values for small x. In
the end the algorithm has no idea how to vary the parameters in order to
find their best values.

//The best approach would be a linear fit of log(y) values/.

*My comment:*
An expert would disagree. Many amateurs are quickly fascinated when they
realise that one can take the logarithm (or another function) along one
or both axes to simplify a fit problem. In fact some problems become
linear when such a transformation is made so that an iterative fit
becomes non-iterative. However the fit after transformation will
generally result in (slightly) different results. What happens is that
weight of each point changes. (A correct fit procedure also takes
account of the error on the points). Levenberg-Marquardt is not least
square fit as mentioned above. It is an iterative *algorithm
*that performs least square fit to data and is used when the functional
form is non-linear. It cannot give the absolute minimum of chi-squared,
rather it converges to a local minimum nearest to the starting values.
There are known reasons for its failure or non-convergence under certain
circumstances, The statement "/ In the end the algorithm has no idea how
to vary the parameters in order to find their best values."  /is
wrong./ /The algorithm is general and works, irrespective of the
specific functional form. Instead of taking the log of the y-axis
values, one should include the error bar  (weight=1/error-squared) of
each point in the chi-square definition. It is true that you can get
quick and stable results by taking the logarithm of y-values, but
estimation of the errors on the deduced parameters could not be made
correctly. Transforming the data (especially the logarithmic model) is
widely used in the literature, but in my opinion its better to
investigate the failure of the Levenberg-Marquardt algorithm in this case.

Best regards
Ambar Chatterjee


To unsubscribe from this list goto http://iuac.res.in/~elab/phoenix , enter your email ID, choose Unsubscribe and submit.

Other related posts: