PHYS 310 - Experimental Physics Uncertainty Estimation |
example1.dat
example2.dat
example3.dat
example1.dat
, example2.dat
, and
example3.dat
, with values of the independent variable
in column 1, values of the dependent variables in column 2, and the
uncertainties in column 3, then the basic command for weighted fitting
is
gnuplot> fit [function] ["filename"] using 1:2:3 via [parameter list]
The results of the fit are displayed on the screen and stored in a
file with the default name fit.log
. The file
fit.log
contains all
values of the fit parameters, all standard errors, and all independent
elements of the correlation matrix. (The correlation matrix is related to the
covariance matrix, which is the inverse of the curvature matrix.)
Gnuplot and Mathematica give identical results for these quantities;
both gnuplot and Mathematica give errors that differ from some books'
definitions by a factor of the square root of the reduced chi-square.
example1.dat
, the fit command is
gnuplot> fit m "example1.dat" using 1:2:3 via m
and the log file is example1.fit.log
example2.dat
, the fit command is
gnuplot> fit m*x + b "example2.dat" using 1:2:3 via m,b
and the log file is example2.fit.log
example3.dat
, the fit command is
gnuplot> fit a1 + a2*x + a3*x**2 "example3.dat" using 1:2:3 via
a1,a2,a3
and the log file is example3.fit.log