Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #4180 > unrolled thread
| Started by | "hugocoolens@gmail.com" <hugocoolens@gmail.com> |
|---|---|
| First post | 2019-04-14 08:19 -0700 |
| Last post | 2019-04-14 23:46 -0700 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
strange discrepancy between stats command result and fitting result "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2019-04-14 08:19 -0700
Re: strange discrepancy between stats command result and fitting result Karl Ratzsch <mail.kfr@gmx.net> - 2019-04-14 18:56 +0200
Re: strange discrepancy between stats command result and fitting result "hugocoolens@gmail.com" <hugocoolens@gmail.com> - 2019-04-14 23:46 -0700
| From | "hugocoolens@gmail.com" <hugocoolens@gmail.com> |
|---|---|
| Date | 2019-04-14 08:19 -0700 |
| Subject | strange discrepancy between stats command result and fitting result |
| Message-ID | <09207591-2b4d-4b5a-8460-cec754f3496d@googlegroups.com> |
I am puzzled by the following discrepancy between a stats command result and the result which I have from normal Gnuplot fitting: This is my Gnuplot batch-file datafile='scallogmet.dat' f(x)=a*log10(x)+b a=-1.06 b=-4.78 fit [3e-3:1] f(x) datafile using ($1):($2) via a,b stats [3e-3:1] datafile using (log10($1)):($2) This is the content of scallogmet.dat: 0.001 -0.4421 0.002 -1.4743 0.003 -1.7844 0.004 -1.9640 0.005 -2.102 0.01 -2.483 0.02 -2.837 0.03 -3.034 0.04 -3.173 0.05 -3.28 0.1 -3.614 0.2 -3.96 0.3 -4.143 0.5 -4.408 1 -4.8 2 -5.294 3 -5.655 4 -5.96 5 -6.244 6 -6.509 7 -6.755 8 -7 9 -7.232 10 -7.46 The Gnuplot fitting gives me y=ax+b, with the correct a=-1.16816 and b=-4.78604 But the stats-command gives: y = -3.104 x - 4.194 Why do U get the wrong result with stats? thanks in advance
[toc] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2019-04-14 18:56 +0200 |
| Message-ID | <q8vone$p69$1@solani.org> |
| In reply to | #4180 |
Am 14.04.2019 um 17:19 schrieb hugocoolens@gmail.com: > I am puzzled by the following discrepancy between a stats command result and the result which I have from normal Gnuplot fitting: > f(x)=a*log10(x)+b > a=-1.06 > b=-4.78 > fit [3e-3:1] f(x) datafile using ($1):($2) via a,b > stats [3e-3:1] datafile using (log10($1)):($2) > > > The Gnuplot fitting gives me y=ax+b, with the correct a=-1.16816 and b=-4.78604 > But the stats-command gives: y = -3.104 x - 4.194 Not problem with fit or stats, your range setting for stats was wrong: you have to logarithmise it as well stats [log10(3e-3):log10(1)] $dat using (log10($1)):($2) and the linear model that comes out is y = -1.168 x - 4.786 ;-)
[toc] | [prev] | [next] | [standalone]
| From | "hugocoolens@gmail.com" <hugocoolens@gmail.com> |
|---|---|
| Date | 2019-04-14 23:46 -0700 |
| Message-ID | <f7a4082c-dcba-4f62-ab69-0e04b315c311@googlegroups.com> |
| In reply to | #4181 |
On Sunday, April 14, 2019 at 6:56:16 PM UTC+2, Karl Ratzsch wrote: > Am 14.04.2019 um 17:19 schrieb hugocoolens@gmail.com: > > I am puzzled by the following discrepancy between a stats command result and the result which I have from normal Gnuplot fitting: > > > f(x)=a*log10(x)+b > > a=-1.06 > > b=-4.78 > > fit [3e-3:1] f(x) datafile using ($1):($2) via a,b > > stats [3e-3:1] datafile using (log10($1)):($2) > > > > > > The Gnuplot fitting gives me y=ax+b, with the correct a=-1.16816 and b=-4.78604 > > But the stats-command gives: y = -3.104 x - 4.194 > > > Not problem with fit or stats, your range setting for stats was > wrong: you have to logarithmise it as well > > stats [log10(3e-3):log10(1)] $dat using (log10($1)):($2) > > and the linear model that comes out is y = -1.168 x - 4.786 > > ;-) Thanks a lot! kind regards, Hugo
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web