On 28/04/12 11:48, Antonio wrote:
Hello everybody,
I checked Veusz linear fit against a certified data set coming from NIST:
Statistical Reference Datasets http://www.itl.nist.gov/div898/strd/ .
In particular,  the first one I used was the Norris dataset you could find here:
http://www.itl.nist.gov/div898/strd/lls/data/Norris.shtml .
Maybe I did something weird and stupid  but the line fit does not look like the
data plot and coefficients are pretty different from certified ones.

I checked the dataset against gnuplot, gnumeric, extrema, labplot, SSP, PSPP,
... and the fit looks allright with them.

Thanks - I didn't get the line to fit initially, but that appears to be because it doesn't have any uncertainties associated with it. Veusz assumes 5% errors if there are no uncertainties, which doesn't work in some cases with the minimisation procedure. Probably because the 5% errors give lots of weight to the values near zero. I haven't tested whether pyminuit does a better job (veusz supports this as an optional fitting module).

If I set the error bars to be constant it works a lot better and gives values close to those quoted. I should investigate whether there is a problem with a code or whether veusz should do a better job at guessing what the uncertainties are. Maybe constant errors are better than fractional. See attached veusz file.

Veusz needs a better interface for the fitting. I plan to add a proper fitting dialog box in the future, but there are lots of other things to do to!

Jeremy


# Veusz saved document (version 1.15)
# Saved at 2012-04-30T18:54:08.270239

AddImportPath(u'/home/jss/code/veusz-git/veusz')
ImportString(u'x(numeric)','''
2.000000e-01
3.374000e+02
1.182000e+02
8.846000e+02
1.010000e+01
2.265000e+02
6.663000e+02
9.963000e+02
4.486000e+02
7.770000e+02
5.582000e+02
4.000000e-01
6.000000e-01
7.755000e+02
6.669000e+02
3.380000e+02
4.475000e+02
1.160000e+01
5.560000e+02
2.281000e+02
9.958000e+02
8.876000e+02
1.202000e+02
3.000000e-01
3.000000e-01
5.568000e+02
3.391000e+02
8.872000e+02
9.990000e+02
7.790000e+02
1.110000e+01
1.183000e+02
2.292000e+02
6.691000e+02
4.489000e+02
5.000000e-01
''')
ImportString(u'y(numeric)','''
1.000000e-01
3.388000e+02
1.181000e+02
8.880000e+02
9.200000e+00
2.281000e+02
6.685000e+02
9.985000e+02
4.491000e+02
7.789000e+02
5.592000e+02
3.000000e-01
1.000000e-01
7.781000e+02
6.688000e+02
3.393000e+02
4.489000e+02
1.080000e+01
5.577000e+02
2.283000e+02
9.980000e+02
8.888000e+02
1.196000e+02
3.000000e-01
6.000000e-01
5.576000e+02
3.393000e+02
8.880000e+02
9.985000e+02
7.789000e+02
1.020000e+01
1.176000e+02
2.289000e+02
6.684000e+02
4.492000e+02
2.000000e-01
''')
SetDataExpression(u'y2', u'y', symerr=u'0.1', linked=True)
Add('page', name='page1', autoadd=False)
To('page1')
Add('graph', name='graph1', autoadd=False)
To('graph1')
Add('axis', name='x', autoadd=False)
Add('axis', name='y', autoadd=False)
To('y')
Set('direction', 'vertical')
To('..')
Add('xy', name='xy1', autoadd=False)
Add('fit', name='fit1', autoadd=False)
To('fit1')
Set('values', {u'a': -0.2571113581435878, u'b': 1.0021043729050798})
Set('yData', u'y2')
To('..')
To('..')
To('..')

_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à