Here are the results for the fit shown in Fig. \ref{627293}:
chi-square test value \(\chi_{\min}^2\) = 15.3
degrees of freedom \(\nu\) = 25 - 3 = 22
reduced chi-square = 0.694
fractional probability of \(\chi^2\) ≤ 15.3 is 15.0%
fractional probability of \(\chi^2\) > 15.3 is 85.0%
Here, \(\sigma=\ \sqrt{2\ \nu}=6.6\), \(\chi_{mean}^2\ -\ \sigma\ =\ 15.4\), and \(\chi_{mean}^2\ +\ \sigma\ =\ 28.6\), indicating that our result is very slightly outside one standard deviation of the mean but well within two standard deviations. We conclude that we have acceptably good agreement between model and experiment at this level of experimental precision but that further improvements in apparatus design, measurement method, and reduction in uncertainty are merited.
Data Smoothing and Differentiation
Savitzky-Golay filters
Data smoothing is a way of reducing time varying noise in measured data so as to reveal the underlying dependence of the measured variable on a different variable (such as an applied voltage or an external magnetic field). In most cases, the computer is acting as a digital low pass filter. It differs from an analog low pass output filter in that the filtering is done by us using a computer after the measurement is complete rather than by the instrument itself. Like the signal averaging done by a digital oscilloscope — the point by point averaging of a periodic signal — data smoothing seeks to separate random noise from a reproducible signal, but here the measured 'signal' to be smoothed is not assumed to be periodic and is in fact usually a function of a variable other than time. An example would be the measurement of current as a function of applied voltage for a non-ohmic device.
The SciPy (for scientific python) package offers an exhaustive list of
signal processing functions useful for the digital filtering. If you have some programming experience in Python, you may wish to design your own filter, perhaps using the lower level scipy.signal
filter design tools. There are, for example, a wide variety of spectral analysis and peak finding routines for frequency data that we will not explore further here.
In this getting start guide, we will focus on the use of a particularly useful and easy to use ready-made filter for
data smoothing of
\(y\left(x_i\right)\) data equally spaced in
\(x\): the
Savitzky-Golay low pass filter
\cite{Savitzky_1964,Steinier_1972}. This filter works by fitting a subset of data points adjacent to a particular data point with a low-degree polynomial, evaluating the polynomial at that point, and then repeating the process for each data point. The set of points centered about a particular data point is called the 'filter window' and the number of points in the filter window is called the
window length (although
width would seem more apt). The picture here might be of a small window in a cabin looking out upon a nearby data stream. The window reveals a small subset of points at a time as the data "streams" by. The fit is carried out on the points seen through the window, and repeated for each point in the stream.
As a bonus, the SciPy Savitzky-Golay filter function scipy.signal.savgol_filter
can also be used to numerically differentiate the smoothed data (again, provided the data is "equally spaced"). This is a particularly useful feature. For example, we might directly measure \(I\left(V\right)\) for a particular non-ohmic device (such as a light bulb or LED) but be more interested theoretically in the differential current \(\frac{dI}{dV}\) as a function of applied voltage \(V\). Experimentally, the noise fluctuations in a measurement of \(I\) as a function of \(V\)might preclude a direct calculation of \(\frac{dI}{dV}\). By first smoothing the data using a Savitzky-Golay filter to reduce the noise, a meaningful calculation of \(\frac{dI}{dV}\) as a function of \(V\) can now be carried out.