Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Brendan Halpin Newsgroups: comp.graphics.apps.gnuplot Subject: Re: fit gives different results for identical functions with different var names Date: Fri, 21 Dec 2012 00:55:15 +0000 Lines: 15 Message-ID: <878v8s4424.fsf@wivenhoe.ul.ie> References: <4da37e57-cdcd-474e-a3c3-7e98f09b1cb6@googlegroups.com> Reply-To: brendan.halpin@ul.ie Mime-Version: 1.0 Content-Type: text/plain X-Trace: individual.net xpEUciGYmCYw3C11N678iAIAX8phdBPDxZoXrwD8ddT0cYUvREViQi9GFDHkQBluoK Cancel-Lock: sha1:HXv8I2HBwMSB50Qvv2riidvxta0= sha1:eLSHgS7MGsPyrCc92YL68s9F1b0= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Xref: csiph.com comp.graphics.apps.gnuplot:1549 Does it help to put all the variables in the function argument list? i.e. fa(xa,aa,ma,sa) = aa*exp(-(xa-ma)**2/(2*sa**2)) Otherwise you are referring to global variables in the body of the function, which might be the source of the instability. Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F1-009 x 3147 mailto:brendan.halpin@ul.ie ULSociology on Facebook: http://on.fb.me/fjIK9t http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@ULSociology