X-Received: by 10.140.150.216 with SMTP id 207mr7387500qhw.15.1461792057460; Wed, 27 Apr 2016 14:20:57 -0700 (PDT) X-Received: by 10.50.61.200 with SMTP id s8mr382559igr.3.1461792057401; Wed, 27 Apr 2016 14:20:57 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!88no932962qga.1!news-out.google.com!k10ni146igv.0!nntp.google.com!i5no132331ige.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Wed, 27 Apr 2016 14:20:57 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=142.90.101.112; posting-account=kySdhwoAAABMLr3RTV7ADVUi8CcCu6NT NNTP-Posting-Host: 142.90.101.112 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9cfd0f50-bf35-4757-ad85-609228cfa91f@googlegroups.com> Subject: Re: Gaussian fit - Singular matrix in Invert_RtR From: Andrew Finlay Injection-Date: Wed, 27 Apr 2016 21:20:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.graphics.apps.gnuplot:3314 On Wednesday, April 27, 2016 at 1:29:37 PM UTC-7, Hans-Bernhard Br=F6ker wr= ote: > Am 27.04.2016 um 19:38 schrieb Andrew Finlay: >=20 > > I'm trying to write code to automatically fit binned simulation data >=20 > Bad idea. 'fit' is not a tool to be used blindly, or automatically. >=20 > Non-linear least-squares fitting needs guidance and consideration of the= =20 > condition of the input, or you'll run into numerical instabilities much= =20 > of the time. I understand where you're coming from here, but I thought my initial parame= ters were close enough that the algorithm should have been able to converge= , though maybe I was wrong. And they weren't chosen blindly, the starting = parameters are based on the mode and the standard deviation of the unbinned= data points. I played around with those parameters some, I got rid of the= "Singular matrix in Invert_RtR" error, but now it just doesn't modify my p= arameters at all. I don't know if I've simply hit the limits of what fit c= an do. Here's a link to an image of what I came up with anyway: https://dr= ive.google.com/open?id=3D0B2-M7wNoiJi2bUF3MTkwMmN4bFE > So let's see why this particular fit failed. Well, for starters the=20 > data is quite clearly not Gaussian at all. It's highly asymmetrical,=20 > and the tails are way to wide for compared to the FWHM. >=20 > Trying to fit a Gaussian to that data is an exercise in futility. I would argue that the peak is Gaussian to first order approximation. It's= not truly Gaussian obviously, but you should still be able to produce an a= pproximate fit. Though perhaps not in gnuplot... Thanks anyway.