## Fundamentals of graphical data processing

Let us begin by meditating for a moment on the meaning of graphical data processing. First of all, let's emphasize and highlight the clarity and a kind of attractiveness of graphs (as opposed to tables and other means), the possibility to quickly spot physical dependence, to detect and estimate random and gross measurement error, unexpected tendency in measured values. Graphical processing will help us to quickly evaluate the correctness and reliability of measurements, the choice of method, theoretical assumptions, etc.

The basis of the graphical processing is the presentation of the observed values together with the theoretical dependence in a common graph, i.e. the immediate possibility of comparing theory and practice and evaluating the deviations. Usually, however, the theory contains parameters typical for the given conditions and materials, while graphical processing means finding such optimal values of all parameters that the resulting theoretical dependence best represents the measured values (which we assume). This is based on the principle of maximum likelihood, or the least squares method, which is implemented in time-tested and proven algorithms in many scientific programs. In our physical application, it is mostly a fitting of measured data with a model function (not to be confused with regression, which is a method in statistical research, although mathematically the two procedures are equivalent).

In experimental physics, we should use fitting as often as possible to find parameters $p_i$ with physical meaning (with a so-called fit error $\Delta p_i$). To do this, we need to measure as accurately as possible multiple points of a certain physical dependence $f_\mathrm{exp}(p_i; x, y, z, t)$ and express this dependence with a mathematically appropriate model function $f(\dots)$. For example, we measure the dependence of the path $s(t)$ traveled in time $t$ and fit the measured points with a quadratic function with three parameters

$$ s(t) = s_2 t^2 + s_1 t + s_0 $$

(the absolute term $s_0$ has the meaning of the initial position at time $0^,\mathrm{s}$, the coefficient of the linear term $s_1$ represents the initial velocity, and the coefficient of the quadratic term $s_2$ has the physical meaning of half the acceleration). By fitting, we determine the optimal, and hence most likely, values of these parameters, which are obviously of interest to us. If the fit corresponds well with the data, we are lucky and have chosen the model function well (e.g., the quadratic dependence if it is uniformly accelerated motion). Otherwise, we need to choose a different model dependence and assumptions (e.g., acceleration varies and try a cubic function). We don't always have to fit over all parameters, but only some that we need to find out (e.g. for motion in a gravitational field – we know the acceleration and are only interested in the initial position and velocity). What all the graphical processing represents and contains is given below, together with instructions on how to do this, e.g. in the freely distributable scientific program GNUPLOT.