Bucknell PHYS 310 - Experimental Physics
Uncertainty Estimation

Physics Department | About | Faculty & Staff | Major Reqs. | Courses | Facilities & Resources | Astronomy | Research & REU | Seminar

NOTE: Mathematica notebooks are written for Version 7

Mathematica Notebook with some tools for problems from Taylor

Notes: Uncertainties via Monte Carlo Methods

Sample Data Files

In all of the data files below the format is the same. The data for each point is on a single line in the file. The first number on each line is the x-value, the second is the y-value, and the third is the uncertainty in the y-value. (Uncertainties in the x-values are assumed to be negligible.)

Mathematica Notebooks (executable and pdf)

Fitting with Gnuplot

Gnuplot does the same fitting as Mathematica, although I don't think you can get quite as many details as are available in Mathemtica's RegressionReport. If your data file is structured like 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.

Examples


This page maintained by
Marty Ligare, mligare@bucknell.edu

Valid HTML 4.0!