Least-squares fitting of data with large errors - ACS Publications

final adjustment of the fitting function evaluated for that datum.However, if we assume that the “true” value is represented well enough by the ca...
0 downloads 0 Views 1MB Size
Truman P. Kohman

Carnegie-Mellon University Pittsburgh, Pennsylvania 15213

Least-Squares Fitting of Data with Large Errors

Two recent papers in THIS JOURNAL (1, 9) point out that, in the least-squares fitting of experimental data having a wide range of magnitudes by an analytical function containing several adjustable parameters, i t is usually more appropriate to minimize the sum of the squares of the relative residuals than of the absolute residuals. The relative residual for a particular input datum (y& defined as the diierence between that and the calculated value of the function C f r ) divided by the former. Thus the simplest least squares conditions

are replaced by the conditions

Here a, is one of the adjustable parameters of the fuuction f, which may have several arguments. This is simply a special case of the well-known use of weighting factors (w,)

the weighting factor for each datum being taken as Y,-~. Deming (3) states, "Of course, in some lines of work, the weight of y is approximately inversely proportional to y2, whence the weight of log y is practically constant, independent of y." The authors of one of the abovementioned papers (9) have pointed out that a t least one textbook (4) describes an equivalent approach to weighting factors, and there are undoubtedly others. I have been using this approach, when appropriate, for over two decades (5, 6). However, only recently have I noticed that the above definition of relative residuals gives erroneous results in the case of experimental data with relatively large uncertainties and hence occasional large errors. I n principle, the difficulty is present even when the errors are small. Consider first the case where positive and negative errors of the same magnitude are equally probable; that is, for example, an experimental value 125% of the "true"va1ue is as likely as one 75y0 of the "true"va1ue. Each such datum should have an equal effect on the final adjustment of the fitting function evaluated for that datum. However, if we assume that the "true" value is represented well enough by the calculated value, then t,he low datum would contrihute 0.111 to the sum of the squares of the relative deviations as defined These considerations were developed during investigations supported by the US. Atomic Energy Commission under Contract No. AT(30-1)-844. Report No. NYO-844-77.

above, whereas the high datum would contrihute only 0.04. If the errors are 90%, the respective contributions would be 81 and 0.224. Clearly, the data with large negative errors will have disproportionate influence on the resulting "best" values of the parameters. The situation can be corrected, for this case, by using for the relative residual the absolute residual divided by the calculated value of the function

Then positive and negative 25% errors will each contribute 0.0625 to the sum of squares, and 90% errors will each contribute 0.81 regardless of sign. However, when uncertainties are quite large, positive and negative errors of the same magnitude may not be equally likely. . A +200y0 error may occur, but a -200% error cannot if we are dealing with an inherently positive quantity. Equal error factors are more likely to be equally probable. An error factor of 1.25 on the high side will give a datum 125% of the "true" value; on the low side, 1/1.25 = 80%. Data 200% and 50% of the "true" value, corresponding to error factors of 2, would be equally probable. I n this case, as in the first, use of the first definition of relative residuals gives inordinately large weights to low data. For a 1.25 error factor, the low datum would contribute 0.0625 to the sum of squares, whereas the high datum would contrihute only 0.04. For an error factor of 2, the respective contributions would be 1.00 and 0.25; for a factor of 10, 81 and 0.81. However, in this case the second definition of relative residuals does not correct the unbalance hut simply reverses it: high data outweigh equally probable low data disproportionately. For example, with an error factor of 2, a low datum now contributes 0.25 and a high one 1.00. I n this case the remedy can be found by using for the relative residual the absolute residual divided by the geometric mean of the input and calculated value of the quantity

Now high and low data with the same error factors each make the same contribution to the sum of squares: for error factors of 1.25,2, and 10, the contributions are respectively 0.05, 0.5, and 8.1. Moreover, data with large error factors are prevented from making extremely large contributions and thus completely dominating the adjustment of the parameters. According to one authority (7),"The usual custom is to assign weights arbitrarily" in least-squares adjustments. Obviously, an objective criterion is desirable. Volume 47, Number 9, September 1970 / 657

Judgment must be used in selecting such a criterion just as in assigning individual weights. I n this note two new are proposed' It is suggested that the second of these will be most appropriate in the majority of cases where other criteria are lacking, Even where another criterion is available, the inclusion of the factors ( y ~ t f , )in- ~the overall weighting factors may be beneficial. Literature Cited ~ , P.., A N D SNOW, R. L., J . CHEM.EDUC..44,756 (1961). (1) ~ h - o e n r oK.

658 / Journal o f Chemicol Educofion

(21 SMITX. E. n.. A N D MATAEIYS. D. ns., J. CHEM. EDUC.,44.757 (19671. (3) D ~ u r n cW , . D.."Statistiod Adjustment of Data." John Wilev 6: Sona. IX.. N ~ W ~ o r k 1943: . never ~uhlications.Ino.. NEW York, 1964, p. 201. (4) BROWNLEE, K . A,, "St&tisticd Theory and Methodology in Soieooe and ~ ~ ~ Ji O~wile? ~ ~ ~ 6: sons. ~ ~ho., i N ~ york. W ~ 1960, , "pp. 308-12. (51 KOHMAN. T. P.. Manhattan Proiect Report No. (HI CP-3275 (19451; National Nuclear Energy Series. Plutonium Froieot Record, 14B. 1655 (1949). (61 K O ~ M A N T.. P.. *ND BENDER.M. L.. Chspter 7 in "Hid-Enerey Nuclear Reaetiom in Astrophysics" (Editor: Sn%N. B. S. P.1, 11'. A. ~ ~ ~ jI~c., ~ Nm ~ iWyork ~ .1967, PP. 169-245. (7) M A ~ G E N H.. A ~A.N D MURPHY, G. M., "The Mathematics oi Physios and Chemistry," (lat Ed.). 1). van Nostrand Co., h e . . New York. 1943, p. 498: (2nd Ed.), Princeton, 1956, p. 515.