Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3652 > unrolled thread

What's new in gnuplot 5.2

Started byRaoul Fleckman <raoul.fleckman@gmail.com>
First post2017-05-26 21:13 +0000
Last post2017-06-07 14:26 +0200
Articles 11 — 5 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  What's new in gnuplot 5.2 Raoul Fleckman <raoul.fleckman@gmail.com> - 2017-05-26 21:13 +0000
    Re: What's new in gnuplot 5.2 "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-05-31 23:16 -0700
      Re: What's new in gnuplot 5.2 Karl Ratzsch <mail.kfr@gmx.net> - 2017-06-02 10:18 +0200
        Re: What's new in gnuplot 5.2 "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-02 02:32 -0700
          Re: What's new in gnuplot 5.2 Karl Ratzsch <mail.kfr@gmx.net> - 2017-06-02 12:11 +0200
            Re: What's new in gnuplot 5.2 "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-03 12:49 -0700
              Re: What's new in gnuplot 5.2 Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2017-06-03 22:45 +0200
                Re: What's new in gnuplot 5.2 "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-05 01:32 -0700
                  Re: What's new in gnuplot 5.2 Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2017-06-05 14:47 +0200
                    Re: What's new in gnuplot 5.2 "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2017-06-06 23:34 -0700
                      Re: What's new in gnuplot 5.2 Dr Engelbert Buxbaum <engelbert_buxbaum@hotmail.com> - 2017-06-07 14:26 +0200

#3652 — What's new in gnuplot 5.2

FromRaoul Fleckman <raoul.fleckman@gmail.com>
Date2017-05-26 21:13 +0000
SubjectWhat's new in gnuplot 5.2
Message-ID<ac6rb8.ur8.19.1@isomedia.com>
https://lwn.net/SubscriberLink/723818/dbaaa9093072d800/

"This article is a tour of some of the newest features in the gnuplot
 plotting utility. Some of these features are already present in the 5.0
 release, and some are planned for the next official release, which will
 be gnuplot 5.2. Highlights in the upcoming release include hypertext
 labels, more control over axes, a long-awaited ability to add labels to
 contours, better lighting effects, and more; read on for the
 details. ...

(impressive new stuff!)

[toc] | [next] | [standalone]


#3653

From"hugocoolens@gmail.com" <hugocoolens@gmail.com>
Date2017-05-31 23:16 -0700
Message-ID<b30f5dfe-333f-4a47-b61e-ab6e6b0a96fc@googlegroups.com>
In reply to#3652
Op vrijdag 26 mei 2017 23:13:43 UTC+2 schreef Raoul Fleckman:
> https://lwn.net/SubscriberLink/723818/dbaaa9093072d800/
> 
> "This article is a tour of some of the newest features in the gnuplot
>  plotting utility. Some of these features are already present in the 5.0
>  release, and some are planned for the next official release, which will
>  be gnuplot 5.2. Highlights in the upcoming release include hypertext
>  labels, more control over axes, a long-awaited ability to add labels to
>  contours, better lighting effects, and more; read on for the
>  details. ...
> 
> (impressive new stuff!)

Is it possible to put in an easy way constraints on the fitting parameters in this version of Gnuplot? I've always missed something like being able to put in "0<a<10" for a function fit with a as a parameter?

kind regards,
Hugo

[toc] | [prev] | [next] | [standalone]


#3657

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-06-02 10:18 +0200
Message-ID<ogr70t$1b2$1@solani.org>
In reply to#3653
Am 01.06.2017 um 08:16 schrieb hugocoolens@gmail.com:
> Is it possible to put in an easy way constraints on the fitting parameters in this version of Gnuplot? I've always missed something like being able to put in "0<a<10" for a function fit with a as a parameter?

Unfortunately not, but for some good reason.

It's not a simple thing to add constraints to the Marquardt-Levenberg
algorithm, because it's not clear (and probably very problem-dependent)
what should happen when the parameter approaches that limit. You
probably know the feature from "OriginPro", and most people i know agree
that it messes up their fitting routines quite a bit.

Most often when one parameter wants to diverge, that is because the
given function does not really describe the data or the starting values
are bad. Trying to predetermine them by fitting only certain parts of
your data using simplified functions is usually helpful.

  Karl



[toc] | [prev] | [next] | [standalone]


#3658

From"hugocoolens@gmail.com" <hugocoolens@gmail.com>
Date2017-06-02 02:32 -0700
Message-ID<022e551d-f7c4-44a1-973b-f8db0375854b@googlegroups.com>
In reply to#3657
Op vrijdag 2 juni 2017 10:18:39 UTC+2 schreef Karl Ratzsch:
> Am 01.06.2017 um 08:16 schrieb hugocoolens@gmail.com:
> > Is it possible to put in an easy way constraints on the fitting parameters in this version of Gnuplot? I've always missed something like being able to put in "0<a<10" for a function fit with a as a parameter?
> 
> Unfortunately not, but for some good reason.
> 
> It's not a simple thing to add constraints to the Marquardt-Levenberg
> algorithm, because it's not clear (and probably very problem-dependent)
> what should happen when the parameter approaches that limit. You
> probably know the feature from "OriginPro", and most people i know agree
> that it messes up their fitting routines quite a bit.
> 
> Most often when one parameter wants to diverge, that is because the
> given function does not really describe the data or the starting values
> are bad. Trying to predetermine them by fitting only certain parts of
> your data using simplified functions is usually helpful.
> 
>   Karl

I understand the problem but even giving good starting values thus not always help. In fact I most of the time just want to have a parameter "b" strictly positive, I tried to circumvent Gnuplot making it negative  by substituting it by an always positive exp(b), but this is not really an advisable practice and just being able to tell Gnuplot to keep it always positive would be great.

kind regards,
Hugo

[toc] | [prev] | [next] | [standalone]


#3660

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-06-02 12:11 +0200
Message-ID<ogrdkh$4tc$1@solani.org>
In reply to#3658
Am 02.06.2017 um 11:32 schrieb hugocoolens@gmail.com:

> I understand the problem but even giving good starting values thus not always help. In fact I most of the time just want to have a parameter "b" strictly positive, I tried to circumvent Gnuplot making it negative  by substituting it by an always positive exp(b), but this is not really an advisable practice and just being able to tell Gnuplot to keep it always positive would be great.

Just out of curiosity, what is the function you try to fit?

[toc] | [prev] | [next] | [standalone]


#3663

From"hugocoolens@gmail.com" <hugocoolens@gmail.com>
Date2017-06-03 12:49 -0700
Message-ID<ec3a75fe-478f-458a-a42d-4629c2cf45a5@googlegroups.com>
In reply to#3660
Op vrijdag 2 juni 2017 12:11:32 UTC+2 schreef Karl Ratzsch:
> Am 02.06.2017 um 11:32 schrieb hugocoolens@gmail.com:
> 
> > I understand the problem but even giving good starting values thus not always help. In fact I most of the time just want to have a parameter "b" strictly positive, I tried to circumvent Gnuplot making it negative  by substituting it by an always positive exp(b), but this is not really an advisable practice and just being able to tell Gnuplot to keep it always positive would be great.
> 
> Just out of curiosity, what is the function you try to fit?
this is one example:
f(x)=20*log10(a/(1+(x/b)**2)**0.5)
a should be positive but sometimes Gnuplot makes it negative

kind regards,
Hugo

[toc] | [prev] | [next] | [standalone]


#3664

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2017-06-03 22:45 +0200
Message-ID<91f133a9-ec73-423a-fb72-de13397f48aa@t-online.de>
In reply to#3663
Am 03.06.2017 um 21:49 schrieb hugocoolens@gmail.com:


>> Just out of curiosity, what is the function you try to fit?
> this is one example:
> f(x)=20*log10(a/(1+(x/b)**2)**0.5)
> a should be positive but sometimes Gnuplot makes it negative

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)

[toc] | [prev] | [next] | [standalone]


#3669

From"hugocoolens@gmail.com" <hugocoolens@gmail.com>
Date2017-06-05 01:32 -0700
Message-ID<f8c271a2-88bb-4951-8db3-f65800bdd512@googlegroups.com>
In reply to#3664
Op zaterdag 3 juni 2017 22:45:42 UTC+2 schreef Hans-Bernhard Bröker:
> Am 03.06.2017 um 21:49 schrieb hugocoolens@gmail.com:
> 
> 
> >> Just out of curiosity, what is the function you try to fit?
> > this is one example:
> > f(x)=20*log10(a/(1+(x/b)**2)**0.5)
> > a should be positive but sometimes Gnuplot makes it negative
> 
> 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.
I have posted the data here:
https://www.dropbox.com/s/slhg33xoep51i02/karakt.dat?dl=1
And this is the batch-file I used:
https://www.dropbox.com/s/crkpcbvd9a1qq4r/amplitude.gp?dl=1
You will see the sign of "a" toggles to negative when the fitting interval is greater than 80e6 even though the fitting as such seems very good.

kind regards,
Hugo

[toc] | [prev] | [next] | [standalone]


#3670

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2017-06-05 14:47 +0200
Message-ID<epl279FkmeU1@mid.dfncis.de>
In reply to#3669
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.

[toc] | [prev] | [next] | [standalone]


#3674

From"hugocoolens@gmail.com" <hugocoolens@gmail.com>
Date2017-06-06 23:34 -0700
Message-ID<bd839b06-b64d-4888-be75-e83d2a508e4c@googlegroups.com>
In reply to#3670
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.

kind regards,
Hugo

[toc] | [prev] | [next] | [standalone]


#3675

FromDr Engelbert Buxbaum <engelbert_buxbaum@hotmail.com>
Date2017-06-07 14:26 +0200
Message-ID<MPG.33a20f6e7876200d98968a@News.Individual.DE>
In reply to#3674
In article <bd839b06-b64d-4888-be75-e83d2a508e4c@googlegroups.com>, 
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web