Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Dr Engelbert Buxbaum Newsgroups: comp.graphics.apps.gnuplot Subject: Re: What's new in gnuplot 5.2 Date: Wed, 7 Jun 2017 14:26:44 +0200 Organization: private Lines: 114 Message-ID: References: <022e551d-f7c4-44a1-973b-f8db0375854b@googlegroups.com> <91f133a9-ec73-423a-fb72-de13397f48aa@t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 8bit X-Trace: individual.net h6Zbw4m0HUUtrpxMbp61BAgTkcGKSDrBXTKt9qhVTrHaOv6Mna Cancel-Lock: sha1:+GbrE9mM5g8YQXePfXdWyyNUAkM= User-Agent: MicroPlanet-Gravity/3.0.4 Xref: csiph.com comp.graphics.apps.gnuplot:3675 In article , hugocoolens@gmail.com says... > > Op maandag 5 juni 2017 14:47:38 UTC+2 schreef Hans-Bernhard Bröker: > > Am 05.06.2017 um 10:32 schrieb hugocoolens@gmail.com: > > > Op zaterdag 3 juni 2017 22:45:42 UTC+2 schreef Hans-Bernhard Bröker: > > > > >> Often the function can be transformed a bit to lift such requirements. > > >> In this case, you could just fit > > >> > > >> f(x) = 10 * log10(a**2 / (1 + (x / b)**2)) > > >> > > >> or > > >> > > >> f(x) = 20 * log10a - 10 * log10(1 + (x / b)**2) > > \ > > > > > thank you very much for your help, I tried out > > > f(x) = 20 * log10a - 10 * log10(1 + (x / b)**2) but that didn't make > > > any difference. However f(x) = 10 * log10(a**2 / (1 + (x / b)**2)) does make a difference but "a" still becomes negative for certain fitting intervals. > > > > Part of the trick is that this doesn't actually matter. The function is > > identical for parameters a and -a, so you can just throw away the sign > > afterwards. The requirement that a be positive was an artificial one > > from the beginning. > > I admit this wasn't a good example to make my point. However I still wonder why increasing the fitting interval toggles the value of "a" from positive to negative. I have fiddled with such limiting conditions in the past, and in practice the parameter will then be "glued" to that limit and this also affects the fitting of other parameters. What would be useful is the implementation of the Nelder/Mead simplex fitting algorithm in Gnuplot. In my experience it is more stable than Marquard/Levenberg, converges faster even with poor initial values for the parameters and allows the minimisation by other criteria than sum of squares, for example minimum chi-square for non-homoscedastic data (e.g., data going over several orders of magnitude), or minimum median of deviation when data scatter a lot. The only disadvantage of simplex is that the error estimates for fitted parameters have to be calculated by bootstrapping, but with computing power today that is a minor inconvenience. Literature: @ARTICLE{Nel-65, title = {A simplex method for function minimization}, author = {Nelder, J.A. and Mead, R.}, journal = {Computer J.}, year = {1965}, number = {4}, pages = {308-313}, volume = {7}, doi = {10.1093/comjnl/7.4.308}, } @ARTICLE{Cac-84, title = {Fitting Curves to Data: {T}he Simplex Algorithm is the Answer}, author = {Caceci, M.S. and Cacheris, W.P.}, journal = {Byte}, year = {1984}, number = {5}, pages = {340-362}, volume = {9}, language = {eng}, } @BOOK{Pre-89, title = {Numerical recipes in {P}ascal: The art of scientific computing}, author = {W.H. Press and B.P. Flannery and S.A. Teukolsky and W.T. Vetterling}, publisher = {Cambridge University Press}, year = {1989}, address = {Cambridge}, isbn = {978-0-5213-7516-0}, language = {eng}, } @ARTICLE{Str-92, title = {Monte Carlo Method for Determining Complete Confidence Probability Distributions of Estimated Modell Parameters}, author = {Straume, M. and Johnson, M.L.}, journal = {Meth. Enzymol.}, year = {1992}, pages = {117-129}, volume = {210}, doi = {10.1016/0076-6879(92)10009-3}, language = {eng}, } and for an example where Marquard/Levenberg failed completely, but Simplex worked: @ARTICLE{Bux-99b, title = {Co-operating {ATP} sites in the multiple drug resistance transporter {M}dr1}, author = {E. Buxbaum}, journal = {Eur. J. Biochem.}, year = {1999}, pages = {54-63}, volume = {265}, doi = {10.1046/j.1432-1327.1999.00643.x}, language = {eng}, } -- DIN EN ISO 9241-13: 9.5.3 Error messages should convey what is wrong, what corrective actions can be taken, and the cause of the error.