c15-1 (779585), страница 2
Текст из файла (страница 2)
Perhapsthe power flickered during a point’s measurement, or someone kicked the apparatus,or someone wrote down a wrong number. Points like this are called outliers.They can easily turn a least-squares fit on otherwise adequate data into nonsense.Their probability of occurrence in the assumed Gaussian model is so small that themaximum likelihood estimator is willing to distort the whole curve to try to bringthem, mistakenly, into line.The subject of robust statistics deals with cases where the normal or Gaussianmodel is a bad approximation, or cases where outliers are important. We will discussrobust methods briefly in §15.7.
All the sections between this one and that oneassume, one way or the other, a Gaussian model for the measurement errors in thedata. It it quite important that you keep the limitations of that model in mind, evenas you use the very useful methods that follow from assuming it.Finally, note that our discussion of measurement errors has been limited tostatistical errors, the kind that will average away if we only take enough data.Measurements are also susceptible to systematic errors that will not go away withany amount of averaging. For example, the calibration of a metal meter stick mightdepend on its temperature.
If we take all our measurements at the same wrongtemperature, then no amount of averaging or numerical processing will correct forthis unrecognized systematic error.660Chapter 15.Modeling of Dataestimate of the model parameters is obtained by minimizing the quantityχ ≡22N Xyi − y(xi ; a1 . . . aM )i=1σi(15.1.5)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited.
To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).called the “chi-square.”To whatever extent the measurement errors actually are normally distributed, thequantity χ2 is correspondingly a sum of N squares of normally distributed quantities,each normalized to unit variance. Once we have adjusted the a1 .
. . aM to minimizethe value of χ2 , the terms in the sum are not all statistically independent. For modelsthat are linear in the a’s, however, it turns out that the probability distribution fordifferent values of χ2 at its minimum can nevertheless be derived analytically, andis the chi-square distribution for N − M degrees of freedom. We learned how tocompute this probability function using the incomplete gamma function gammq in§6.2. In particular, equation (6.2.18) gives the probability Q that the chi-squareshould exceed a particular value χ2 by chance, where ν = N − M is the number ofdegrees of freedom. The quantity Q, or its complement P ≡ 1 − Q, is frequentlytabulated in appendices to statistics books, but we generally find it easier to usegammq and compute our own values: Q = gammq (0.5ν, 0.5χ2).
It is quite common,and usually not too wrong, to assume that the chi-square distribution holds even formodels that are not strictly linear in the a’s.This computed probability gives a quantitative measure for the goodness-of-fitof the model. If Q is a very small probability for some particular data set, then theapparent discrepancies are unlikely to be chance fluctuations. Much more probablyeither (i) the model is wrong — can be statistically rejected, or (ii) someone has lied toyou about the size of the measurement errors σi — they are really larger than stated.It is an important point that the chi-square probability Q does not directlymeasure the credibility of the assumption that the measurement errors are normallydistributed.
It assumes they are. In most, but not all, cases, however, the effect ofnonnormal errors is to create an abundance of outlier points. These decrease theprobability Q, so that we can add another possible, though less definitive, conclusionto the above list: (iii) the measurement errors may not be normally distributed.Possibility (iii) is fairly common, and also fairly benign.
It is for this reasonthat reasonable experimenters are often rather tolerant of low probabilities Q. It isnot uncommon to deem acceptable on equal terms any models with, say, Q > 0.001.This is not as sloppy as it sounds: Truly wrong models will often be rejected withvastly smaller values of Q, 10−18, say. However, if day-in and day-out you findyourself accepting models with Q ∼ 10−3 , you really should track down the cause.If you happen to know the actual distribution law of your measurement errors,then you might wish to Monte Carlo simulate some data sets drawn from a particularmodel, cf. §7.2–§7.3.
You can then subject these synthetic data sets to your actualfitting procedure, so as to determine both the probability distribution of the χ2statistic, and also the accuracy with which your model parameters are reproducedby the fit. We discuss this further in §15.6. The technique is very general, but itcan also be very expensive.At the opposite extreme, it sometimes happens that the probabilityQ is too large,too near to 1, literally too good to be true! Nonnormal measurement errors cannotin general produce this disease, since the normal distribution is about as “compact”66115.2 Fitting Data to a Straight Lineσ2 =NX[yi − y(xi )]2 /(N − M )(15.1.6)i=1Obviously, this approach prohibits an independent assessment of goodness-of-fit, afact occasionally missed by its adherents.
When, however, the measurement erroris not known, this approach at least allows some kind of error bar to be assignedto the points.If we take the derivative of equation (15.1.5) with respect to the parameters ak ,we obtain equations that must hold at the chi-square minimum,0=N Xyi − y(xi )∂y(xi ; . . . ak . . .)i=1σi2∂akk = 1, . . . , M(15.1.7)Equation (15.1.7) is, in general, a set of M nonlinear equations for the M unknownak . Various of the procedures described subsequently in this chapter derive from(15.1.7) and its specializations.CITED REFERENCES AND FURTHER READING:Bevington, P.R.
1969, Data Reduction and Error Analysis for the Physical Sciences (New York:McGraw-Hill), Chapters 1–4.von Mises, R. 1964, Mathematical Theory of Probability and Statistics (New York: AcademicPress), §VI.C. [1]15.2 Fitting Data to a Straight LineA concrete example will make the considerations of the previous section moremeaningful. We consider the problem of fitting a set of N data points (xi , yi ) toa straight-line modely(x) = y(x; a, b) = a + bx(15.2.1)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).as a distribution can be. Almost always, the cause of too good a chi-square fitis that the experimenter, in a “fit” of conservativism, has overestimated his or hermeasurement errors. Very rarely, too good a chi-square signals actual fraud, datathat has been “fudged” to fit the model.A rule of thumb is that a “typical” value of χ2 for a “moderately” good fit is22χ ≈ ν.
More√ precise is the statement that the χ statistic has a mean ν and a standarddeviation 2ν, and, asymptotically for large ν, becomes normally distributed.In some cases the uncertainties associated with a set of measurements are notknown in advance, and considerations related to χ2 fitting are used to derive a valuefor σ. If we assume that all measurements have the same standard deviation, σi = σ,and that the model does fit well, then we can proceed by first assigning an arbitraryconstant σ to all points, next fitting for the model parameters by minimizing χ2 ,and finally recomputing.















