Comments on the simplex algorithm culminating in quadratic

Chem. , 1989, 61 (15), pp 1786–1787. DOI: 10.1021/ac00190a039. Publication Date: August 1989. ACS Legacy Archive. Cite this:Anal. Chem. 61, 15, 1786...
2 downloads 0 Views 257KB Size
Anal. Chem. 1089, 61 1786-1787

1786

I

Table 111. Performance of Programs P1, P2, and P3 with Test Function 6 no. of function

program REQMIN spproximmion hw failed.

I \

Yes

I

I

Figure 2. An addendum to the simplex algorithm (above thebroken line in Figure 1) that exploits eq 8 and 10.

Table 11. Performance of Programs P1 and P2 with Five Test Functions no. of

function

program

REQMIN

1

P1

10-13

P2

10-10

P1

10-13 10-10 10-13 10-10 10-13 10-10 10-13 10-10

2

P2 3

P1 P2

4

P1 P2

5

P1 P2

a

function evaluations

function min

60 49 151 142 206 203 238 230 457 349

3.8 X 9.1 x 1043 3.1 X 10% 1.7 X 10% 1.1 x 10-7 a

1.9 x 10-7 5.5 x 10-10 8.2 x 10-7 a

Quadratic approximation failed.

(6) y = CKI(Aj- xl(l - exp(-x2tj))]2;starting point 1,l. This corresponds to the least-squares problem defined in ref 12, where the 18 observed values of A and t are listed. For these test runs the side length of the initial simplex was 1, and the maximum number of function evaluations allowed (N-MAX) was 1000. For the maximum allowed variance of function values, REQMIN, various values were tried: It was found that with program P1 a suitable value was and with programs P2 and P 3 a suitable value was Results with functions 1-5 are reported in Table 11. These functions all have minima of zero. The table shows that whenever the quadratic approximation did not fail, P2 achieved a lower function minimum after a smaller number of function evaluations than P1. Of course, the value of REQMIN could be adjusted so as to achieve a different trade-off between speed and accuracy. Functions 3 and 5 do not approximate to a quadratic form, even in the close vicinitv of the minimum. In both cases the failure of the quadratic approximation was clearly shown by the fact that the inequality (3) was not satisfied. I t seems likely that this kind of situation would be rare in dealing with least-squares problems; if it did arise, one would clearly need to disregard any errors derived via eq 4 or eq 10. Phillips and Eyring (3) did not use the quadratic approximation to help locate the function minimum, but only as a

Sir: In an earlier paper (I),we discussed a method proposed by Nelder and Mead (2) for estimating parameter errors in nonlinear least-squares data analysis using the sequential

P1

1043

P2 P3

10-10 10-10

evaluations

76 67 64

function min

param uncertainties

0.0036029589 0.0036028120 0.0088;0.0104 0.0036028090 0.0083:0.0098

means of estimating errors. With their method, a relatively small value of REQMIN must be used to locate the minimum precisely. As Table I1 shows, the method is less efficient than the kind of strategy used in P2, except when the quadratic approximation fails. Because of the smallness of REQMIN, the variations in yi (at any rate when calculated by using single precision) may be strongly influenced by round-off errors, necessitating enlargement of the simplex before proceeding with the quadratic approximation, as originally suggested by Nelder and Mead (I). Such an enlargement compounds the inefficiency of the method, because of the additional function evaluations needed. Results with function 6 are reported in Table 111. This function has a minimum of 0.0036028045.. . . Clearlv P2 and P 3 are superior to P1, both in rate of convergence and in providing estimates of the errors. P2 and P 3 give similar results, but P2, unlike P3, requires n(n + 1)/2 function evaluations at the halfway points. This is not a problem for simple functions such as 6, but for complex functions of many parameters it can be a problem. We regularly use a program similar to P 3 to adjust spectral parameters so as to minimize the deviation between calculated and observed electron spin resonance spectra (13). In a typical example the number of parameters might be 13, and a function evaluation might take 40 s, using an IBM PC. In this situation the additional n(n + 1)/2 function evaluations required by P2 would take about 1 h.

LITERATURE CITED (1) Nelder, J. A.; Mead, R. Comput. J. 1965, 8 , 308. (2) Spendley, S.N.; Hext, G. R.; Himsworth, F. R. Technometrics 1962, 4 , 441. (3)Phillips, G. R.; Eyrlng, E. M. Anal. Chem. 1988. 60, 738. (4) Bevington, P. R. beta Reduction and Error Analysis for the Physical Sciences; McGraw-Hill: New York, 1969;eq 8-24, 11-13,8-30. (5) Spendley, W. I n Optimization: Symposium of the Institute of Methematics and its AppNcations, University of Keele, England, 7968; Fletcher, R.. Ed.: Academic: New York, 1969;p 259. (6) O'Neill, R. Appi. Stat. 1971, 2 0 , 338. 1978, 7 , (7) Demlng, s. N.; Parker, I . R. CRC Crit. Rev. A&.

187.

(8) Benyon, P. R. Appi. Stat. 1976, 25, 97. (9) Aberg, E. R: Gustavsson, A. G. T. Anal. Chim. Acta 1982, 744, 39. (IO) Daniels, R. W. Introduction to Numerical Methods and Optimization Techniques; North-Holland New York, 1978. (11) Chambers, J. M.; Ertel, J. E. Appi. Stat. 1974, 23, 250. (12) Deming, S.N.; Morgan, S.L. Anal. Chem. 1973, 4 5 , 278A. (13)Beckwith, A. L. J.; Brumby, S. J. Magn. Res. 1987, 73, 252.

Steven Brumby Research School of Chemistry Australian National University G.P.O. Box 4, ACT 2601, Australia RECEIVEDfor review July 28, 1988. Accepted April 17, 1989.

simplex method. There were several errors in the paper, and a correction has appeared in print (3). In the preceding paper Brumby ( 4 ) discusses a second approach to this problem due

0003-2700/89/0361-1786$01.50/00 1989 American Chemical Society

Anal. Chem. 1989, 6 1 , 1787-1789

to Spendley (5) and corrects some mistakes in the literature. It should be noted that ref 3 and 4 use different definitions in Table I. It is the purpose of this comment to clarify several misrepresentations of our article (I),not to dispute the validity of Brumby's approach. The following discussion will use the notation of ref 4. In this notation, P1 is a modified simplex method without quadratic convergence (5), P2 uses P1 plus the method of ref 1-3, and P3 uses Brumby's method added to P1. (1) Reference 4 states that single- and double-precision versions of programs P1-3 did not always give the same results "possibly because of errors in calculating the variance of function values". It should be noted that ref 1 codes the simplex algorithm in single precision except for the function values, yi, and variance calculations, which are done in double precision to avoid round-off errors. The work of Chambers and Ertel (6) was cited in ref 1 to reinforce this point. (2) Reference 4 incorrectly states that Phillips and Eyring use the quadratic approximation only for error estimation, and not in locating the precise minimum of the function. (3)Brumby is also mistaken when he states that P2 requires an extremely small value of REQMIN to locate the precise minimum. For example, the six test functions considered in ref 4 used the same value of REQMIN for P2 and P3 and a value 3 orders of magnitude smaller for PI. (4) It is not our contention that the simplex must be contracted until round-off error strongly influences the result, and the simplex then enlarged. The simplex is enlarged only if required to obtain reliable error estimates.

1787

Finally, a general comment concerning execution times is in order. The last paragraph of ref 4 discusses the routine use of P3 to fit a 13-parameter function. Results in ref 2,4, and 7 suggest such a problem will require several hundred iterations and several hours for minimization and is not a typical example. Simplex routines are fairly competitive with other methods for a small number of parameters, but become much less efficient than Newton-Raphson or quasi-Newton routines for more than five parameters (6-11).

LITERATURE CITED Phillips, G. R.; Eyring, E. M. Anal. Chem. 1988, 6 0 , 738-741. Nekier, J. A.; Mead, R. Comput. J. 1985, 8 , 308-313. Philllps, G. R.; Eyring, E. M. Anal. Chem. 1988, 6 0 , 2656. Brumby, S . Anal. Chem., preceding paper in this issue. Spendley, W. I n Optimization: Symposium of the Institute of Mathematics and its Applications, University of Keele, England, 1968; Fletcher, R., Ed.; Academic Press: New York, 1969. Chambers, J. M.; Ertel, J. E. Appl. Stat. 1974, 2 3 , 250-251. Reddy, B. R. Appl. Spectrosc. 1985, 3 9 , 480-484. Powell, M. J. D. SIAMRev. 1070, 12, 79-97. Chambers, J. M. Biometrika 1973. 6 0 , 1-13. Oisson, D. M.; Nelson, L. S. Technometrics 1975, 17, 45-51. Bard, Y. Nonlinear Parameter Estimation; Academic Press: New York, 1974.

G. R. Phillips E. M. Eyring* Department of Chemistry University of Utah Salt Lake City, Utah 84112 RECEIVED for review February 27, 1989. Accepted April 17, 1989. This research was supported in part by the Office of Naval Research.

TECHNICAL NOTES Construction of an Optically Transparent Thin-Layer-Electrode Cell for Use with Oxygen-Sensitive Species In Aqueous and Nonaqueous Solvents Matthew B. G. Pilkington, Barry A. Coles, and Richard G . Compton*

Physical Chemistry Laboratory, Oxford University, South Parks Road, Oxford OX1 3QZ, England We present a design for a reusable optically transparent thin-layer-electrode (OTTLE) cell, which is easy to assemble and does not require technical skills or services. All the complex parts are obtainable as standard items from the manufacturers quoted (vide infra). Designs for 02-free nonaqueous OTTLE cells have appeared in the literature (1-8). However, unlike the cell reported here, these all required instrument-making facilities for construction. The cell can be reused without dismantling for either aqueous or nonaqueous work. Leakage is not a problem over the lifetime of several experiments, and an additional advantage is the ability to thermostat the cell (0-40 "C). EXPERIMENTAL SECTION The main cell body was an Hellma optically transparent flowthrough cell available in UV-visible and IR quartz glass (catalog no. 136K,light path lengths of 100, 200, and 500 jim, Hellma (England), Ltd., Westcliffe-on-Sea,Essex, England). The working chamber was formed by sandwiching a semitransparent gold minigrid (100wires/in., 80% transmittance, Buckbee Mears 0003-2700/69/036 1- 1787$01.50/0

Co., St. Paul, MN) between the two cell plates (Figure 1). The solution under investigation could flow in the direction indicated. This aided cleansing and drying of the cell for experimentation on different solutions. The dimensions of the working chamber were as shown (Figure 1). In order to prevent leaks due to the Au minigrid passing out through the gap between the cell plates, the cell was heated while being held together firmly by a Hellma metal flowthrough cell holder (catalogno. 013.000)and low-melting wax (facial depilatory wax, Vychem, Ltd., Poole, Dorset, England) fed into the gap by capillary action. This wax has excellent adhesion to silica, melts at 50 "C, sets rigidly on cooling, and dissolves (for dismantlinglcleaning purposes) in ethanol. This provided an adequate seal for acetonitrile, dichloromethane, and water. The cell was jacketed with flowing argon to prevent O2 from diffusing through the wax seal. A slot could be ground with simple glassworking facilities to allow the electrode to be introduced without altering the path length of the original cell, but an 02-freeseal would still be required at the point of entry of the minigrid. The use of a thermoplastic material for sealing allows easy assembly and disassembly with little risk of breakage-an important consideration with silica components-and justifies 0 1989 American Chemical Society