Correction of Temperature-Induced Spectral ... - ACS Publications

Compared with other methods, designed for the same purpose, such as continuous piecewise direct standardization, LSS has the advantages of straightfor...
0 downloads 0 Views 132KB Size
Anal. Chem. 2005, 77, 1376-1384

Correction of Temperature-Induced Spectral Variations by Loading Space Standardization Zeng-Ping Chen, Julian Morris, and Elaine Martin*

Centre for Process Analytics and Control Technology, School of Chemical Engineering and Advanced Materials, University of Newcastle upon Tyne, Newcastle upon Tyne, NE1 7RU, U.K.

With a view to maintaining the validity of multivariate calibration models for chemical processes affected by temperature fluctuations, loading space standardization (LSS) is proposed. Through the application of LSS, multivariate calibration models built at temperatures other than those of the test samples can provide predictions with an accuracy comparable to the results obtained at a constant temperature. Compared with other methods, designed for the same purpose, such as continuous piecewise direct standardization, LSS has the advantages of straightforward implementation and good performance. The methodology was applied to shortwave NIR spectral data sets measured at different temperatures. The results showed that LSS can effectively remove the influence of temperature variations on the spectra and maintain the predictive abilities of the multivariate calibration models. Spectroscopy in combination with multivariate calibration models has been increasingly widely applied in process monitoring applications.1-5 In industrial on-line and in-line applications, the spectral measurements are not recorded under well-controlled laboratory conditions. One consequence of this is that fluctuations in external variables, such as temperature, will result in a nonlinear shift and a broadening of the spectral bands.6-12 Hence, using the spectra in the development of a calibration model will materialize in the resulting predictions being poor. Consequently, the cor* Corresponding author. Tel.: +44 191 222 6231. Fax: +44 191 222 5785. E-mail: [email protected]. (1) Blaser, W. W.; Bredeweg, R. A.; Harner, R. S.; LaPack, M. A.; Leugers, A.; Martin, D. P.; Pell, R. J.; Workman, J., Jr.; Wright, L. G. Anal. Chem. 1995, 67, 47R-70R. (2) Togkalidou, T.; Fujiwara, M.; Patel, S.; Braatz, R. D. J. Cryst. Growth 2001, 231, 534-543. (3) DeThomas, F. A.; Hall, J. W.; Monfre, S. L. Talanta 1994, 41, 425-431. (4) Frank, I. E.; Feikema, J.; Constantine, N.; Kowalski, B. R. J. Chem. Inf. Comput. Sci. 1984, 24, 20-24. (5) Hall, J. W.; McNeil, B.; Rollins, M. J.; Draper, I.; Thompson, B. G.; Macaloney, G. Appl. Spectrosc. 1996, 50, 102-108. (6) Czarnecki, M. A.; Liu, Y. Ozaki, Y.; Suzuki, M.; Iwahashi, M. Appl. Spectrosc. 1993, 47, 2162-2168. (7) Hazen, K. H.; Arnold, M. A.; Small, G. W. Appl. Spectrosc. 1994, 48, 477483. (8) Iwata, T. Koshoubu, J.; Jin, C.; Okubo, Y. Appl. Spectrosc. 1997, 51, 12691275. (9) Libnau, F. O.; Kvalheim, O. M.; Christy, A. A.; Toft, J. Vib. Spectrosc. 1994, 7, 243-254. (10) Liu, Y.; Czarnecki, M. A.; Ozaki, Y. Appl. Spectrosc. 1994, 48, 1095-1101. (11) Liu, Y.; Czarnecki, M. A.; Ozaki, Y.; Suzuki, M.; Iwahashi, M. Appl. Spectrosc. 1993, 47, 2169-2171. (12) Ozaki, Y.; Liu, Y.; Noda, I. Appl. Spectrosc. 1997, 51, 526-535.

1376 Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

rection of external factors on the spectra is essential for the building of a robust calibration model for process analysis. A number of methodologies13-23 have been proposed for addressing the problem of temperature fluctuations. Of these, implicit modeling, where temperature is included in the calibration experimental design, is the most straightforward. Wu¨lfert et al. investigated the performance of implicit modeling for a short-wave NIR spectral data set14 and concluded that a global PLS model gave acceptable predictive performance but that the final model was more complex. Furthermore, with neither the temperature of the calibration nor future samples being included explicitly as independent or dependent variables in the model, the accuracy of the results is suboptimal. Wu¨lfert et al.15 also investigated approaches based on the explicit inclusion of temperature in the calibration model by treating the temperature of the samples either as an additional independent variable appended to the spectra or as another dependent variable. Their results showed that this approach does not give any improvement in terms of the prediction estimates over those attained for the implicit inclusion approach. An alternative approach is that of the synthetic model.16 This methodology utilizes constant-temperature data that are augmented with a classical least-squares estimate of the spectral effect of temperature obtained from variable-temperature aqueous sample spectra. This approach has been demonstrated to significantly reduce errors when predicting concentrations from spectra of solutions at variable temperatures. Since the synthetic model assumes a linear temperature effect and requires the concentrations of all the chemical components in the training mixture (13) Gentlemen, D. J.; Obando, L. A.; Masson, J. F.; Holloway, J. R.; Booksh, K. S. Anal. Chim. Acta 2004, 515, 291-302. (14) Wu ¨ lfert, F.; Kok, W. Th.; Smilde, A. K. Anal. Chem. 1998, 70, 1761-1767. (15) Wu ¨ lfert, F.; Kok, W. Th.; Noord, O. E. de; Smilde, A. K. Chemom. Intell. Lab. Syst. 2000, 51, 189-200. (16) Haaland, D. M. Appl. Spectrosc. 2002, 54, 246-254. (17) Swierenga, H.; Wu ¨ lfert, F.; Noord, O. E. de; Weijer, A. P. de; Smilde, A. K.; Buydens, L. M. C. Anal. Chim. Acta 2000, 411, 121-135. (18) Wang, Y.; Veltkamp, D. J.; Kowalski, B. R. Anal. Chem. 1991, 63, 27502756. (19) Wang, Y.; Kowalski, B. R. Anal. Chem. 1993, 65, 1301-1303. (20) Wu ¨ lfert, F.; Kok, W. Th.; Noord, O. E. de; Smilde, A. K. Anal. Chem. 2000, 72, 1639-1644. (21) Ba¨rring, H. K.; Boelens, H. F. M.; Noord, O. E. de; Smilde, A. K. Appl. Spectrosc. 2001, 55, 458-466. (22) Eilers, P. H. C.; Marx, B. D. Chemom. Intell. Lab. Syst. 2003, 66, 159-174. (23) Chen, Z. P.; Martin, E.; Morris, J. Dycops 2004. 10.1021/ac040119g CCC: $30.25

© 2005 American Chemical Society Published on Web 02/03/2005

samples, it only works well for white chemical systems24 (or fully characterized chemical systems) with relatively small temperature variations (e.g., from 20 to 25 °C; see Haaland16). If the temperature fluctuates over a wide range, the nonlinear effects cannot be fully modeled by a synthetic model approach. Calibration models based on robust variable selection can provide satisfactory results in terms of the prediction errors.17 However, a limitation of variable selection models is that special expertise and software is required. It was also proven15 that nonlinear effects cannot be filtered out or resolved through an orthogonal basis transformation such as a wavelet transformation. A full description of the effect of temperature on the spectra is therefore only possible through the application of nonlinear methods. Piecewise direct standardization (PDS)18,19 is a well-established method for the correction of complex nonlinear spectral variations between measurements that have been performed on two different instruments or under two different sets of conditions (say two different temperatures, for example). However, the main limitation of this method is its inability to handle the continuous nature of temperature. To overcome this limitation, Wu¨lfert et al. generalized PDS to continuous variables, continuous piecewise direct standardization (CPDS).20,21 The CPDS algorithm results in polynomials being fitted to the corresponding elements of the discrete PDS transformation matrices for different temperatures. The transformation matrix for a new temperature can then be estimated through the derived polynomials. It has been shown that the performance of CPDS is good and it can maintain the same level of prediction errors as the local calibration models despite fluctuations in the temperature. CPDS requires the identification of three meta parameters (the number of latent variables, the width of the band, and the degree of the polynomial). The setting of these meta parameters is crucial to the performance of CPDS. The optimization procedures for these meta parameters are complex and time-consuming. Moreover, the assumption that the corresponding elements of the discrete PDS transformation matrices under different temperatures follow simple smooth nonlinear models such as second-order polynomials has not been explicitly explained or proven. These invalidated assumptions reduce the confidence in the predictions attained from the application of CPDS. With a view to compensating for temperature effects on spectra, Eilers and Marx22 extended penalized signal regression to allow the incorporation of temperature as a covariate. A smooth surface on the wavelength-temperature domain is then estimated using tensor products of B-splines and penalties (forcing the vector of regression coefficients to vary smoothly with wavelength) along the two dimensions. A slice of this surface gives a smooth vector of coefficients for weighting a spectrum to predict the unknown concentration of a chemical component. Like CPDS, the performance of the proposed method depends on three meta parameters that control the influence of the penalties. A grid search is used to locate the optimums of the three meta parameters that minimize the leave-one-out cross-validation standard error of prediction. The optimization procedure can be time-consuming in practice. Although the authors claim that the proposed model is easy to use (24) Liang,Y. Z.; Kvalheim, O. M.; Manne, R. Chemom. Intell. Lab. Syst. 1993, 18, 235-250.

and has many good features, methodologies with fewer or without meta parameters are more desirable. Recently, individual contribution standardization (ICS)23 has been proposed to eliminate the temperature effects on the predictive abilities of calibration models for white chemical systems. In ICS, it was assumed that the absorbance of each chemical species in every wavelength follows a simple smooth nonlinear function with respect to temperature. ICS has the advantages of good performance and straightforward implementation. Furthermore, it does not require the same training samples to be measured at all training temperatures. Unfortunately, since ICS was specifically designed for white chemical systems, it cannot be applied directly to gray chemical systems24 (or incompletely characterized chemical systems). In this paper, the ideas behind ICS are generalized and loading space standardization (LSS) is proposed as a methodology for the correction of temperature-induced spectral variations for gray chemical systems. The method is evaluated on an NIR data set, and the results are compared with those from the application of CPDS. THEORY Assume the rows of Xm×n(t1), Xm×n(t2), ..., and Xm×n(tK) are the corresponding spectra for the same m training mixture samples measured at training temperatures t1, t2, ..., tK (m and n are the number of samples and discrete wavelength positions, respectively). Only the concentrations of the target chemical components for these training mixture samples are known. Utilizing these K spectral data matrices, K partial least-squares (PLS1) calibration models can be built. However, if the temperature effects are not taken into account, the local calibration model built on spectral data measured at temperature tK can only provide accurate predictions for test samples measured at the same temperature. As mentioned previously, temperature is a continuous variable in process analytical applications and thus it is not possible to build a separate local calibration model for every temperature. To apply the calibration models established at the training temperatures to future test samples measured at other temperatures, it is necessary to model the temperature effects and then standardize the spectra of future test samples to the corresponding spectra as though they had been measured at the training temperatures. Continuous Piecewise Direct Standardization. To correct for the influence of temperature, CPDS20 adopts the following strategy. The first step is to construct a PLS calibration model between the spectral data X(tref) and the concentration matrix Y for a specific reference temperature tref selected from the training temperatures. Discrete calibration transformation matrices between the spectra measured at the rest of the training temperatures and the reference temperature are then found by PDS:18

X(tref) ) X(tk)Q(tk),

(k ) 1, 2, ‚‚‚, K; tk * tref)

(1)

where Q(tk), the transformation matrix, is a banded matrix that corrects for the spectral variations resulting from the temperature difference between two distinct measurement temperatures. Q(tk) is obtained by regressing the elements xj(tref) (wavelength j, reference temperature tref) on a window from xj-w(tk) to xj+w(tk) (2 × w + 1: the width of the window size), using PLS. Q(tk) is then Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

1377

assembled by placing the regression vectors bj(tk) on the jth column ranging from row j - w to j + w. The next step is to fit a polynomial to each element on the bands of the transformation matrices Q(tk), (k ) 1, 2, ‚‚‚, K; tk * tref) against the temperature difference ∆tk (∆tk ) tk - tref). 2

qi,j(tk) ) ai,j + bi,j∆tk + ci,j∆tk + ei,j

[

Xav ) [Uav,s Xav,n]

Λav,s1/2 Λav),n1/2

]

[Vav,s, Vav,n]T )

Tav,sPav,sT + Tav,nPav,nT (5) Tav,s ) Uav,s Λave,s1/2, Tav,n ) Uav,nΛav,s1/2, Pav,s )

(2)

Vav,s, Pav,n ) Vav,n (6)

With the parameters of all the polynomials estimated, the transformation matrix Q(ttest) for the spectral matrix X(ttest) of test samples measured at temperature ttest can be calculated. After this, the temperature influences are removed using the relationship

where the subscripts “s” and “n” signify that the corresponding factors represent the spectral information and noise, respectively, and superscript “T” denotes the transpose. Assuming Beer’s law is valid, then Xav ) YSav + Eav (where Y denotes the concentration K matrix, Sav ) ∑k)1 X(tk)/K are the mean of the pure spectra matrices that are not available for gray chemical systems, and Eav is the matrix of residuals). It can be proven that there exists a full rank matrix R that satisfies eq 7:

X(tref|ttest) ) X(ttest)Q(ttest)

(3)

The concentrations can then be predicted by the local model at the reference temperature. Loading Space Standardization. In previous studies,23,25,26 it was found that the temperature effects on the absorbance of each chemical component in mixture samples can be modeled by second-order polynomials:

si,j(tk) ) ai,j + bi,jtk + ci,jtk2 + ei,j(tk)

Y ) Tav,sR

(7)

Therefore, the following equation holds:

X(tk) ) YS(tk) + E(tk) ) Tav,sRS(tk) + E(tk)

(8)

(4) Letting P(tk) ) (RS(tk)T:

si,j(tk) is the element in the ith row and jth column of matrix Sc×n(tk), whose rows are the corresponding pure spectra of c chemical components in the training mixture samples at temperature tk. ei,j(tk) is the residual. With these polynomials being estimated from the pure spectra matrices S(t1), S(t2), ‚‚‚, and S(tK), the temperature-induced spectral variations of future samples can be successfully removed.23 The above strategy involves the pure spectra of all the chemical components for all training temperatures that can be resolved from the spectral data matrices of the training mixture samples, if the concentrations of all the chemical components in the training mixture samples are known. However, the concentrations of all the chemical components in the training mixture samples are only available for white chemical systems. For gray chemical systems, the concentrations of the target chemical components may only be known. Thus it is difficult, if not impossible, to obtain the pure spectra of all the chemical components in the training mixture samples of gray chemical systems. Since the relationship between the elements of S(tk) and temperature can be modeled by second-order polynomials, it can be proven that one can also fit second-order polynomials to the elements of Rc×c × Sc×n(tk) against temperature (Rc×c is any matrix that is invariant with respect to temperature). Compared with S(tk), it is easier to obtain R × S(tk) from the spectral data matrices X(t1), X(t2), ..., and X(tK). More specifically, a matrix consisting of any c spectra of X(tK) is an alternative form of R × S(tk). However, to suppress the possible influence of noise, singular value decomposition of the spectral data matrices is considered. K Suppose Xav ) ∑k)1 X(tk)/K, the singular value decomposition of Xav can be expressed as (25) Lewiner, F.; Klein, J. P.; Puel, F.; Fe´votte, G. Chem. Eng. Sci. 2001, 56, 2069-2084. (26) Dunuwila, D. D.; Berglund, K. A. J. Cryst. Growth 1997, 179, 185-193.

1378

Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

P(tk)T ) RS(tk) ≈ (Tav,s)+ X(tk),

(k ) 1, 2, ‚‚‚, K)

(9)

Here, superscript “+” denotes the Moore-Penrose matrix inverse. The columns of the loading matrix P(tk) are linear combinations of the rows of S(tk) (the pure spectra measured at temperature tk). As stated previously, a polynomial can be fitted to each element of P(tk) (k ) 1, 2, ‚‚‚, K) against the temperature tk:

pi,j(tk) ) ai,j + bi,jtk + ci,jtk2 + ei,j(tk)

(10)

The concept in eq 10 can be extended to higher-order polynomials, and the number of temperature levels (K) should be at least one more than the order of the polynomials adopted. After ai,j, bi,j, K and xi,j have been estimated by minimizing ∑k)1 ei,j2(tk), the loading matrix P(ttest) at test temperature ttest (which should be measured along with the spectrum of the test sample) can be calculated. Given the spectra X(ttest) of test samples measured at temperature, ttest, their scores on the loading vectors of P(ttest) can be estimated as T ) X(ttest)(P(ttest)T)+. The score matrix T can then be used to transform X(ttest) into X(tk|ttest), as if it were measured under training temperature, tk:

X(tk|ttest) ) T(P(tk) - P(ttest))T + X(ttest)

(11)

Here, T(P(tk) - (P(ttest))T can be considered as the difference between X(ttest) and X(tk|ttest) resulting from the temperature variation. After the transformation of X(ttest) to X(tk|ttest), the calibration model established under training temperature, tk, can be used to predict the concentration of the target components in the test mixture samples. A set of calibration models can then be built from the spectra measured for each of the training temper-

Table 1. Mole Fractions of the Training and Test Samples sample no.a

ethanol

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

0.6644 0.6715 0.6663 0.4998 0.5003 0.4994 0.5003 0.3332 0.3324 0.3328 0.3222 0.3351 0.1663 0.1670 0.1662 0.1622 0 0 0

mole fractions water 0.3356 0.1631 0 0.5002 0.3330 0.1672 0 0.6668 0.5003 0.3340 0.1655 0 0.6669 0.5000 0.3331 0.1630 0.6671 0.4997 0.3339

Table 2. Prediction Errors (RMSEP) of the Test Sets for the PLS Local Models with Four Latent Variables temp (°C)

RMSEP

2-propanol

sample

model

ethanol

water

2-propanol

0 0.1654 0.3337 0 0.1667 0.3334 0.4997 0 0.1672 0.3331 0.5123 0.6649 0.1668 0.3330 0.5006 0.6748 0.3329 0.5003 0.6661

30 40 50 60 70

30 40 50 60 70

0.0177 0.0106 0.0166 0.0098 0.0112

0.0092 0.0067 0.0111 0.0043 0.0038

0.0124 0.0093 0.0218 0.0083 0.0147

a

Samples with boldface numbers are training samples; the rest are test samples.

atures (t1, t2, ..., tK), and the model with the temperature closest to that of the test samples can be selected to make the predictions. The main feature of the correction procedure is the standardization of the loading space. Therefore, in the following discussions, it will be referred to as LSS. Two parameters require to be estimated to build a LSS correction model, the degree of the polynomials and the number of factors describing the spectral information. The degree of the polynomial depends on the nonlinearity of the temperature effects. Previous studies23,25,26 have shown that the temperature effects can be modeled by secondorder polynomials. It is noted that the number of factors in LSS should be no less than the number of detectable chemical components in the mixture samples. A strategy for selecting this parameter is discussed in the subsequent sections. APPLICATION Near-IR Spectral Data. Wu¨lfert et al.20 presented a set of NIR data to demonstrate the performance of CPDS. It was assembled from 95 NIR spectra of 19 ternary mixtures of ethanol, water, and 2-propanol (Table 1), which were recorded in the range 5801049 nm with a resolution of 1 nm using a HP 8454 spectrophotometer, equipped with a thermostable cell holder at five temperatures (30, 40, 50, 60, and 70 °C). The spectral region between 749 and 849 nm was used for slope and offset correction, and the 200 absorbances in the range 850-1049 nm formed the basis of the data analysis. The 19 samples at each temperature were divided into 13 training samples and 6 test samples according to the same strategy as Wu¨lfert et al. Experimental details can be found in their paper, and the data are available at http://wwwits.chem.uva.nl. Since the best values of all three parameters for the development of a CPDS model have previously been determined for this data set, they form the basis of the comparison between CPDS and the proposed LSS approach. Performance Criterion. The root-mean-square error of prediction (RMSEP) is used as the performance criterion to assess

the predictive power of LSS and CPDS and is calculated as follows:

RMSEP )

x∑

Ntest(y i,test i)1

- yˆi,test)2

Ntest

(12)

Here, yi,test is the known concentration of the ith test sample, yˆi,test denotes the corresponding value estimated from the LSS or CPDS model and Ntest denotes the number of test samples. The data analysis was performed on a Pentium class computer using Matlab version 6.5 (Mathworks, Inc). All the programs including LSS, CPDS, and PLS1 were written in-house. RESULTS AND DISCUSSION The mean-centered spectra and concentrations of ethanol, water, and 2-propanol define the prediction (X) and predicted (y) variables, respectively, used in building the PLS1 models. For each chemical component, five local PLS1 calibration models were built including four latent variables (as suggested by Wu¨lfert et al.14) from the spectra of the training samples measured at the five different training temperatures (30, 40, 50, 60, and 70 °C). The prediction errors for the five local models for the test data sets for the different temperatures are given in Table 2. Before any detailed discussion on the performance of LSS is undertaken, the validity of the assumption behind LSS is first verified. Figure 1 displays the first three loading vectors calculated according to eqs 5 and 9 from the spectra of the training samples measured at all training temperatures. It is evident that the variations in the elements of the three loading vectors with respect to temperature follow simple smooth nonlinear functions. To investigate the appropriateness of second-order polynomials for the modeling of the temperature effects, second-order polynomials were fitted to the elements of the loading matrices calculated from the spectra of the training samples for four of the training temperatures. The resulting models were then used to predict the loading matrix for the temperature not included in the model building. Figure 2 shows typical results from these analyses. The first three loading vectors of the predicted loading matrix for 70 °C are in good agreement with the actual ones (Figure 2a). The difference between the predicted and the actual values for the first two loading vectors is negligible (Figure 2b). Due to the relatively lower significance of the third loading vector, it is more likely to be influenced by noise. Nevertheless, the norm of the difference vector is 0.1021 (10% of the norm of the actual loading vector), which is acceptable especially as it is an extrapolation prediction. Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

1379

Figure 2. (a) First three actual loading vectors (solid) at 70 °C and those estimated (dotted) by LSS using the spectra of the training samples measured at temperatures other than 70 °C, and (b) the corresponding difference vectors (solid, first; dotted, second; and dash, third).

Figure 1. First (a), second (b), and third (c) loading vectors of loading matrices at 30 (solid), 40 (dotted), 50 (medium dash), 60 (dash-dot-dot), and 70 °C (long dash).

The above results confirm the validity of the basic assumption underlying LSS. In the subsequent analysis, the effectiveness of LSS for the correction of temperature-induced spectral variations is illustrated through a typical example. Figure 3a shows the spectra of sample 15 measured at 60 and 70 °C and their difference vector. Significant spectral differences introduced as a consequence of temperature variations can be observed within the range 950 and 1000 nm. When the LSS correction model with three significant components, built from the spectra of the training samples measured at training temperatures other than 70 °C, is applied, the temperature effects are effectively removed (Figure 3b). The absolute differences between the spectra measured at 60 °C and that standardized by LSS from 70 to 60 °C are less than 0.0005 for most wavelengths and only exceed 0.001 in the region between 1025 and 1049 nm due to the relatively larger magnitude of the noise in this region. The predictive performance of the LSS correction model with three significant components is summarized in Table 3. The LSS correction models are built from the spectra of the training 1380 Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

samples measured at all the training temperatures except the test temperature and then used to correct the spectral variations of the test samples resulting from the temperature difference between the local calibration models and the test samples. For example, to utilize the local calibration model built from the spectra of the training samples measured at 30 °C to predict the concentrations of the three chemical components in six test samples from the corresponding spectra recorded at 40 °C, the spectral variations introduced by the temperature difference should first be removed. An LSS correction model is thus built from the spectra of the training samples measured at training temperatures 30, 50, 60, and 70 °C and then applied to transform the spectra of the test samples measured at 40 °C to the corresponding spectra as though they were measured at 30 °C. After correction, the local calibration model at 30 °C can correctly predict the concentrations of the three chemical components in the test samples from the corrected spectra. From Table 3, it can be seen that, for the test samples at 40, 50, and 60 °C, the local calibration models built at temperatures other than the corresponding test temperatures can provide satisfactory results when the LSS correction model is applied. Generally, the local calibration models at temperatures closest to those of the test samples give the best predictions in terms of the RMSEP and are comparable to those values listed in Table 2. For the test samples at 30 and 70 °C, the prediction errors are larger. This is a consequence of the fact that they are the lowest and highest temperatures in the NIR data sets. Extrapolation errors of the LSS correction models thus contribute to the relatively large prediction errors. Nevertheless, the local calibra-

Figure 3. Spectra of test sample 15 measured at 60 (solid) and 70 °C (dotted) and their difference vectors (dash) before (a) and after correction (b) to 60 °C by LSS. Table 3. Prediction Errors (RMSEP) of Test Sets after Application of LSS Correction Model with Three Significant Factors (All the training samples excluding those at test temperature were used in LSS correction model building) Tpredict (°C)

chemical species

30

ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol

40 50 60 70

30

40

Tcalibration (°C) 50 60

0.0119 0.0230 0.0241 0.0136 0.0067 0.0148 0.0213 0.0173 0.0176 0.0186 0.0093 0.0185 0.0377 0.0590 0.0427

0.0095 0.0124 0.0139 0.0123 0.0072 0.0150 0.0195 0.0454 0.0427

0.0131 0.0232 0.0285 0.0120 0.0063 0.0103

0.0111 0.0058 0.0114 0.0196 0.0352 0.0325

0.0119 0.0271 0.0307 0.0091 0.0086 0.0120 0.0151 0.0126 0.0230

70 0.0129 0.0277 0.0364 0.0076 0.0105 0.0154 0.0159 0.0138 0.0289 0.0087 0.0088 0.0107

0.0150 0.0222 0.0263

tion models at 40 and 60 °C can still provide reasonable predictions for test samples at 30 and 70 °C, respectively. The above results are based on an LSS correction model with three significant components (the number of chemical components present in the system). Since the PLS1 local models require

four latent variables, it is reasonable to conclude that there are four significant factors related to the concentrations of the three chemical components in the mixture samples. It is thus hypothesized that LSS correction models with four significant components may give better performance. This hypothesis is supported by the results summarized in Table 4. The prediction errors in Table 4 are generally smaller than the corresponding ones in Table 3. A further increase in the number of factors used in the LSS correction model does not further improve the results, but rather slightly deteriorates the results (not shown), due to the inclusion of factors representing noise. Therefore, the number of factors used in the LSS correction model can be set to be the number of latent variables used for the building of a local PLS1 model, thereby accounting for the spectral information relating to the concentrations of the target chemical components. For comparison, the results of CPDS are given in Table 5. As for the building of the LSS correction models, only the training samples measured at temperatures other than the test temperatures were used to establish the relationship between the transformation matrix of CPDS and temperature. The three parameters of CPDS were taken as the optimal values given in Wu¨lfert et al.20 Generally speaking, the performance of CPDS is also satisfactory. The CPDS models with 50 °C as the reference temperature appear to be superior to those where other temperatures were taken as the reference. Wu¨lfert et al. believed that Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

1381

Table 4. Prediction Errors (RMSEP) of Test Sets after Application of LSS Correction Model with Four Significant Factorsa Tpredict (°C)

chemical species

30

ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol

40 50 60 70

30

40

Tcalibration (°C) 50 60

0.0115 0.0220 0.0234 0.0134 0.0060 0.0136 0.0271 0.0161 0.0275 0.0136 0.0086 0.0102 0.0416 0.0545 0.0140

0.0095 0.0129 0.0169 0.0100 0.0073 0.0110 0.0210 0.0390 0.0305

0.0127 0.0205 0.0246 0.0108 0.0065 0.0088

0.0110 0.0057 0.0111 0.0200 0.0269 0.0242

0.0116 0.0214 0.0233 0.0089 0.0065 0.0094 0.0140 0.0102 0.0186

70 0.0122 0.0210 0.0263 0.0074 0.0044 0.0110 0.0149 0.0095 0.0206 0.0088 0.0063 0.0095

0.0147 0.0175 0.0195

a All the training samples excluding those at test temperature were used in LSS correction model building.

Table 5. Prediction Errors (RMSEP) of Test Sets after Application of CPDS Correction Modela Tpredict (°C)

chemical species

30

ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol ethanol water 2-propanol

40 50 60 70

30

40

Tcalibration (°C) 50 60

0.0532 0.0261 0.0479 0.0120 0.0238 0.0254 0.0177 0.0180 0.0202 0.0165 0.0129 0.0135 0.0210 0.0330 0.0123

0.0098 0.0135 0.0143 0.0110 0.0057 0.0123 0.0221 0.0256 0.0295

0.0246 0.0121 0.0155 0.0125 0.0084 0.0156

0.0103 0.0081 0.0073 0.0334 0.0166 0.0408

0.0470 0.0113 0.0384 0.0153 0.0088 0.0176 0.0136 0.0101 0.0159

70 0.0707 0.0123 0.0587 0.0174 0.0093 0.0208 0.0130 0.0074 0.0134 0.0342 0.0123 0.0397

0.0960 0.0365 0.1296

a All the training samples excluding those at test temperature were used in CPDS correction model building.

selecting a midpoint temperature as the reference leads to better results as the temperature correction does not need to extrapolate from the higher temperatures to the lowest temperature. This argument appears reasonable. However, it does not explain why the CPDS model using 30 °C as a reference can provide the most accurate predictions for the test samples at 70 °C and why the CPDS model with 40 °C as the reference give significantly worse predictions for test samples at 30 °C than the CPDS model with 50 °C as the reference. Moreover, when the CPDS model with 60 °C as the reference is used to predict the concentrations of the three chemical components in the test samples from their spectra measured at 70 °C, the prediction error for 2-propanol is as high as 0.1296, which is almost 7 times higher than the corresponding value attained from the LSS correction model. It is hypothesized that all the above phenomena may indicate that the corresponding elements of the discrete PDS transformation matrices under different temperatures do not follow simple smooth nonlinear functions such as second-order polynomials. 1382

Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

The implementation of LSS is simpler than that of CPDS. Given the data sets of the same training samples recorded at several different training temperatures, one can first build a PLS1 local calibration model for each training temperature and then model the temperature effect through a LSS correction model. For a future test sample at a certain test temperature, all the local calibration models can be used to predict the concentrations of the target chemical components in the test sample after the spectral variation introduced by the temperature difference is removed by applying the LSS correction model. The most appropriate local calibration model for any test sample can therefore be selected without any additional effort. Generally, it should be the one developed from the temperature closest to that of the test sample. However, the situation is different for CPDS. Before establishing a CPDS model, a reference temperature should first be specified. Only the local calibration model at this reference temperature can be used to predict the concentrations of the chemical components in the test sample from its spectrum processed by CPDS. Selecting a different reference temperature requires building a new CPDS model, which can require the implementation of an optimization procedure to determine the values of the three parameters. Even if a CPDS model has been established for every training temperature (as reference), the question of how to select the best model for an arbitrary test sample is still unresolved. Another advantage of LSS is that it only requires the determination of two parameters, i.e., the number of significant factors to retain in the loading spaces and the degree of the polynomials. The former parameter can be set as the number of latent variables used in the building of the local PLS1 calibration models. The polynomial degree depends on the nonlinearity of the external effects (temperature in this paper). Therefore, visual examination of the variation of the significant loading vectors with respect to external effects will help determine this parameter. For enhanced and justifiable results, statistical methods27 can be used to determine the order of the polynomial. Other than the degree of the polynomials, CPDS requires the determination of a further two parameters: the number of latent variables and the width of the band for discrete PDS. The procedure for setting these parameters is relatively complicated and time-consuming. Therefore, the simplicity in setting parameters is also an appealing feature that makes LSS more user-friendly in terms of application than CPDS. Apart from the above two parameters, the number of standardization samples needed for LSS to effectively model the temperature effects is another important issue in the application of this standardization method. The influence of the number of standardization samples on the performance of LSS with four significant factors is illustrated in Figure 4. Two increasing sequences of standardization samples are investigated. The first sequence starts with samples 2, 13, 16, and 10 and then increases by one sample according to the order [4, 18, 7, 1, 17, 12, 8, 19, 3]. The second sequence is [4, 18, 7, 1, 17, 12, 8, 19, 3, 13, 16, 2, 10] with the first four samples forming the initial data set. The RMSEP of ethanol, water, and 2-propanol is used as an index to assess the prediction ability of the local PLS1 models for the spectra of (27) Devore, J.; Peck, R. Statistics: the Exploration and Analysis of Data, 3rd ed.; Duxbury Press: Belmont, CA, 1997.

Figure 4. Influence of the number of standardization samples and increasing sequences (a, [2, 13, 16, 10, 4, 18, 7, 1, 17, 12, 8, 19, 3]; b, [4, 18, 7, 1, 17, 12, 8, 19, 3, 13, 16, 2, 10]) on the prediction precisions of local PLS1 models for the spectra of test samples standardized by LSS with four significant factors (circle, prediction 40 °C, calibration 50 °C; square, prediction 50 °C, calibration 60 °C; triangle, prediction 60 °C, calibration 70 °C).

the test sets processed using an LSS model built on different numbers of standardization samples. Since the temperature levels used in building a LSS model is only one more than the number of parameters in a second-order polynomial, extrapolation predictions for 30 and 70 °C are liable to be affected by small variations and are thus excluded from this discussion. Both panels a and b of Figure 4 suggest that an increase in the number of standardization samples does not necessarily lead to an improvement in the accuracy of the predictions. In practice, no significant differences in the accuracy of the predictions are observed when the number of standardization samples increases from 4 to 13. Examining these two plots more closely reveals that by including samples with only two components in the standardization set of four ternary mixtures (samples 2, 13, 16, and 10), the accuracy of the predictions slightly deteriorate (Figure 4a). In contrast, introducing four ternary mixtures (samples 2, 13, 16, and 10) into the standardization data set comprising samples with only two components improves the results (Figure 4b). It is therefore concluded that as all the samples in the test set are ternary mixtures, their spectral information can only be well represented by a standardization set of ternary mixtures. Hence, the representative ability of the standardization set is more important than the number of standardization samples. A small

representative standardization data set is therefore sufficient to provide satisfactory prediction performance. This is a further desirable feature of LSS, since requiring fewer standardization samples means financial and manpower savings. CONCLUSIONS The influence of temperature fluctuations on the predictive abilities of multivariate calibration models in process analytical applications can be effectively eliminated through the application of the LSS algorithm proposed in this paper. The basic assumption behind LSS is that the absorbance of each chemical species in every wavelength follows simple polynomials with respect to temperature. This assumption has been verified in the literature. From this basis, it can be deduced that the corresponding elements of the loading vectors for spectral data measured at different temperatures can also be described by simple polynomials. The polynomials estimated from the training samples measured at specific training temperatures can then be used to predict the loading vectors at the test temperature. This step plays an important role in correcting the spectral variations resulting from the temperature differences between the multivariate calibration model and the test samples. Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

1383

Compared with other methods for correcting temperature effects, such as CPDS, LSS has the advantages of easy implementation and good performance. There are only two parameters in LSS to be determined, i.e., the number of significant factors to be retained in the loading spaces and the degree of the polynomials. The former can be set as the number of latent variables used in the PLS1 local calibration model. According to previous research, second-order polynomials can be used to account for the temperature effects on IR or NIR spectra. Compared with CPDS, there is no requirement to select a so-called reference temperature from the training temperatures. Hence, once the LSS correction model has been established, the local calibration models at all training temperatures can be used to predict the concentrations of the target chemical components in the test sample. Generally, the calibration model built on the temperature closest to that of the test sample will give more accurate predictions.

1384

Analytical Chemistry, Vol. 77, No. 5, March 1, 2005

Just as for CPDS, one limitation of the LSS model is the requirement to measure the temperature for every spectrum. Moreover, LSS requires that the same training samples are used to record the spectral data sets at different training temperatures. Thus, it may not be applied to historical process data. ACKNOWLEDGMENT Z.-P.C. acknowledges the financial support of the EPSRC grant GR/R19366/01 (KNOW-HOW) and GR/R43853/01 (Chemicals Behaving Badly II).

Received for review June 23, 2004. Accepted September 28, 2004. AC040119G