Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news2.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ingo Thies Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Fitting: How does gnuplot calculate the covariance matrix? Date: Fri, 15 Apr 2011 13:47:47 +0200 Lines: 26 Message-ID: <90qpj4FrbmU1@mid.individual.net> References: <9088euFi3iU1@mid.individual.net> <908n9pF2jaU1@mid.individual.net> <90e7s7F9faU1@mid.dfncis.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net /GqKQFbcWmRWCdolRDSIGwtScszqfjim9FswautAHZDeKU1BrP Cancel-Lock: sha1:XXo62yHp2sJZibLbjn7hSw/UAss= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: <90e7s7F9faU1@mid.dfncis.de> Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:265 On 10.04.2011 19:31, Hans-Bernhard Bröker wrote: >> a = 9.482095E-01 -/+-1.947044E-01, 1.947043E-01 >> b = 4.270960E-01 -/+-8.327496E-02, 8.327495E-02 > > Those errors are _way_ too big. Do yourself a favour and plot your data > along with the model, using parameters modified by those errors: I have now found the reason for the large errorbars. I simply had used the wron degree of freedom for calculating the 68.3% probability ("1 sigma") contours in the (a,b) space. It should be 2 (2 params) for the contours, and even only 1 for a single contouf (cf Numerical Recipes chapter 15.6), but I used ndata-2, which is only valid for the goodness-of-fit estimate. Now the errors are about the same as gnuplot's given a good fit (i.e. \chi^2 \approx ndata-2). Gnuplot seems to assume a good fit always, so the a-b errors do not vary if all sigma(y_i) are scaled by the same factor. Maybe this is a reasonable assumption since otherwise the whole fit is in question. I hope I could repair a bit of the confusion I caused with this thread ;-) -- Gruß, Ingo