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


Groups > comp.graphics.apps.gnuplot > #1551

Re: fit gives different results for identical functions with different var names

X-Received by 10.66.89.74 with SMTP id bm10mr1911072pab.19.1356103930479; Fri, 21 Dec 2012 07:32:10 -0800 (PST)
Received by 10.50.106.193 with SMTP id gw1mr5030721igb.2.1356103930426; Fri, 21 Dec 2012 07:32:10 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.kjsl.com!usenet.stanford.edu!f6no7874695pbd.1!news-out.google.com!6ni51708pbd.1!nntp.google.com!f6no7874692pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.graphics.apps.gnuplot
Date Fri, 21 Dec 2012 07:32:10 -0800 (PST)
In-Reply-To <kb1i3c$st5$1@news.rz.uni-karlsruhe.de>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=65.128.162.237; posting-account=8cqVUQoAAACMqxlqSYFQbFk0lDQXV4ap
NNTP-Posting-Host 65.128.162.237
References <4da37e57-cdcd-474e-a3c3-7e98f09b1cb6@googlegroups.com> <kb1i3c$st5$1@news.rz.uni-karlsruhe.de>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <5c431d1b-bbc9-418b-8707-588d0ff79beb@googlegroups.com> (permalink)
Subject Re: fit gives different results for identical functions with different var names
From Marcus Hanson <marcus.hanson@gmail.com>
Injection-Date Fri, 21 Dec 2012 15:32:10 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.graphics.apps.gnuplot:1551

Show key headers only | View raw


On Friday, December 21, 2012 5:42:08 AM UTC-6, Karl wrote:
> Have you initialized all your variables identically for the three
> functions? And put all the right variable names in the "via" statement? 

> Does it help to put all the variables in the function argument list? 

I have the correct 'via' statements and I have initialized the variables. Here is exactly what I have done:

gnuplot>aa=1;ma=1;sa=1;xa=1;
gnuplot>fa(xa,aa,ma,sa)=aa*exp(-(xa-ma)**2/(2*sa**2))
gnuplot>fit fa(xa,aa,ma,sa) 'test.dat' u 1:2 via aa,ma,sa

This gives aa=55,ma=0.98,sa=1 (rounded off values) with enormous standard errors (on the order of 10^16 to 10^19). These numbers do not even remotely fit the data.

On the other hand, I have tried the following:

gnuplot>a=1;m=1;s=1;x=1;
gnuplot>f(x)=a*exp(-(x-m)**2/(2*s**2))
gnuplot>fit f(x) 'test.dat' u 1:2 via a,m,s

This gives a=236,m=-1,s=-2.6 (also rounded), with standard errors less than 10%. This also fits the function remarkably well by all measures I know.

I tried various different variable names of more than one character, and they all gave exactly identical results, all of them very wrong.

Could this be some setting I accidentally changed a while ago in gnuplot?

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

fit gives different results for identical functions with different var names marcus.hanson@gmail.com - 2012-12-20 13:01 -0800
  Re: fit gives different results for identical functions with different var names Brendan Halpin <brendan.halpin@ul.ie> - 2012-12-21 00:55 +0000
  Re: fit gives different results for identical functions with different var names Karl <mail.kfr@gmx.net> - 2012-12-21 12:42 +0100
    Re: fit gives different results for identical functions with different var names Marcus Hanson <marcus.hanson@gmail.com> - 2012-12-21 07:32 -0800
      Re: fit gives different results for identical functions with   different var names Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-12-21 19:21 +0100
        Re: fit gives different results for identical functions with   different var names Marcus Hanson <marcus.hanson@gmail.com> - 2012-12-21 11:54 -0800
          Re: fit gives different results for identical functions with     different var names Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-12-22 01:31 +0100

csiph-web