Abstract
Due to the complex nature of near-infrared (NIR) spectra, it is usually very difficult to provide quantitative interpretations of spectral data. As a consequence, careful building and validation of calibration models are of fundamental importance prior to development of useful applications of NIR technologies. For this reason, this work presents a statistical study about the NIR spectroscopy, analyzing the NIR behavior when the experimental conditions are changed. Near-infrared spectra were measured at different temperatures and stirring velocities for systems containing a pure solvent and a suspension of polymer powder in order to perform the error analysis. Then, mixtures of xylene and toluene were analyzed through NIR at different temperatures and stirring velocities and the obtained data were used to build calibration models with multivariate techniques. The results showed that the precision of the NIR measurements depends on the analytical conditions and that unavoidable fluctuations of spectral data (or spectral data variability) are strongly correlated, leading to full covariance matrices of spectral fluctuations, which has been surprisingly neglected during quantitative analyses. In particular, modeling of the xylene/toluene NIR data performed with different multivariate techniques revealed that the principal directions are not preserved when the real covariance matrix of measurement errors is taken into account.
Keywords
Introduction
Near-infrared (NIR) spectroscopy is a very robust technique for measurement of process variables and, consequently, for on-line monitoring and control of industrial processes, finding, therefore, application in many different areas, 1 such as agriculture, 2 petrochemistry, 3 pharmaceutics, 4 medicine, 5 process control, 6 among many others. In particular, on-line monitoring techniques have improved significantly with the recent development of spectroscopic methods and fiber optics technology, which allow for the in situ acquisition and interpretation of process data. As a consequence, the long time delays normally involved with sample preparation and laboratory analyses have been reduced in many applications. 7 Santos et al. 7 have recently reviewed the area and the interested reader should refer to this publication for more detailed description of NIR fundamentals and additional applications.
Experimental measurements are subject to perturbations that are not necessarily independent from each other. Perturbations (or experimental fluctuations) can be generated by a large number of factors, including sample preparation, modification of operation procedures, uncontrolled variations of the measurement environment, among many other causes. It is not different with NIR measurements, as light source fluctuations, temperature oscillations, mechanical vibrations (especially at real industrial sites), among other factors, can potentially affect the performance of NIR spectrometers. 8 Besides, fluctuations of certain variables can affect the behavior of other variables, as one can easily understand when temperature and pressure are measured simultaneously in a pressurized vessel. (As temperature increases, pressure is also expected to increase, meaning that temperature and pressure fluctuations cannot be independent in a closed vessel.) Similarly, one can also imagine that fluctuations of light absorbance in neighboring wavelengths must be strongly correlated (as shown in the following sections) in NIR experiments, as it seems reasonable to assume that uncontrolled fluctuations that lead to the random increase of absorbance at λ = 1000 nm, for instance, also lead to the random increase of absorbance at λ = 1001 nm. Despite that, the importance of measurement errors and measurement correlations has been largely overlooked in the literature. This is particularly true in the NIR field, as the detailed statistical analysis of NIR data are still missing in the technical literature.
The main problem related to the existence of varying measurement fluctuations and measurement error correlations is that correlations can affect the model calibration step and the final model performance, although the effects of varying measurement fluctuations and measurement error correlations on model building procedures and obtained model prediction errors have been systematically neglected in NIR applications. In spite of that, it is well-known that calibration models are of fundamental importance for development and implementation of NIR applications.
7
In order to illustrate this point, let us assume that a set of measurement values
In the most general case,
Illustrative Example
In order to illustrate the importance of the previous remarks for model calibration and model building, let us consider the very simple linear model, commonly used for model calibration of simple spectroscopic data (the well-known Beer–Lambert Law):
It is assumed for simplicity and without loss of generality that a pair of data points is available for model calibration: (x1,y1) and (x2,y2). If the independent variable x is free of error, if the dependent variable y is subject to independent fluctuations that follow the Gaussian distribution with zero mean and constant variance σ
2
, then it is possible to formulate the estimation problem through minimization of the following objective function:
9
One must observe that the value of the model calibration parameter a does not depend on the variance of experimental errors σ
2
, which explains why σ
2
is frequently neglected during model development and parameter estimation. However, if the measurement fluctuations change along the experimental grid, when the system is heteroscedastic and
More interesting yet, according to Eq. 1, if the measurement fluctuations are not independent, Eq. 4 becomes:
9
Problem Proposition
Little efforts have been made to evaluate the covariances of measurement uncertainties through experiments in the literature and to introduce such covariances in the modeling step, as shown in Eqs. 1 and 8. In spite of that, as illustrated in the previous section, variances and correlations of measurement errors can affect the calibration problem significantly.
Numerical procedures have been proposed for estimation of covariance matrixes of measurement errors and allow for the simultaneous estimation of covariances of measurement fluctuations and calibration model parameters when sufficiently large sets of industrial data are available.10–12 To the best of our knowledge, these procedures have not been used for NIR model calibrations and characterization of measurement error correlations in NIR experiments. As a consequence, the effects of varying covariance matrixes of measurement fluctuations on model calibration and model performance have not been analyzed yet in NIR problems. Despite that, it is important to recognize that previous studies have attempted to reduce the sensitivity of calibration models to unknown measurement perturbations using different pretreatment techniques,13–16 although not based on the detailed statistical characterization of the measurement fluctuations, as described in terms of variance spectra and covariance matrixes of measurement fluctuations calculated with replicates at distinct experimental conditions.
Based on the previous paragraphs, the present work presents a statistical study about some simple NIR experiments, in order to characterize the importance of measurement error variances and covariances for quantitative NIR analyses. For this reason, NIR spectra are measured at different experimental conditions and the covariance matrices of error fluctuations are computed through experimental replication at each analyzed condition. Afterwards, covariance matrices are used for qualitative and quantitative analyses and for model building.
For illustrative purposes, NIR spectra are measured first at different temperatures and stirring velocities for systems containing a pure solvent and a polymer powder suspension in order to perform the error analyses. Despite the experimental simplicity, these experimental systems are important for analysis of polymerization reactions. The obtained data are used to show that
Experimental
The experimental work was divided into two parts. The first part (Part 1) included experiments for standard error analyses, using NIR spectra obtained at different experimental conditions. Near-infrared spectra were collected for a pure solvent and a polymer powder suspension at different stirring velocities and temperatures. These variables were manipulated because they are subject to frequent perturbations in real polymerization reactions. The second part (Part 2) included experiments for model calibration in a simple chemical system. Mixtures of xylene and toluene were prepared with different concentrations and analyzed at different temperatures and stirring velocities. Xylene and toluene were selected because they are used very frequently in most chemical labs, are miscible in the full concentration range and present similar NIR spectra, which make the calibration process more difficult. It is important to note that equipment dimensions, solvents, temperature, and stirring velocities used in the present manuscript do not limit the scope of this study, as the main objective pursued here is to report variations of measurement error covariances and of how calibration models respond to these variations in NIR experiments.
Part 1: Experiments for Error Analyses
The experimental setup used to perform the experiments comprises a 1.0 L borosilicate tank, whose cover has orifices for sample removal and for introduction of any components (e.g., probe, stirrer, thermocouple, reflux condenser), a microcomputer, a mechanical stirrer with magnetic seal equipped with an impeller of spades, a reflux condenser, a heating/cooling bath connected to the reactor jacket and a NIR-6500 spectrophotometer connected in situ to collect spectra. For more details, the Experimental Unit Schema is presented in the Supplemental Material. Near-infrared spectra were measured in regular intervals of 2 min, using an in situ spectrophotometer NIR-6500 (NIRSystems, Inc., Silver Spring, MD, USA), working in the transflectance mode in the spectral region of 400–2500 nm. The spectra were collected using a stainless steel transflectance probe with a constant path length of 34 cm and diameter of 19 mm, connected to the instrument through a fiber optics cable of 3 m. The fiber optics cable comprised three bundles of fibers. The light bulb contained a filament of tungsten and the light detector was based on the standard PbS technology. Data acquisition was performed with NIR Spectral Analysis Software version 3.30, a software provided by the manufacturer of the NIR spectrometer (Vision(R)). Spectra were recorded as averages of 32 readings with precision of 0.1 nm, according to spectrophotometer specification (NIRSystem Process Analytics Manual version 1.0 NIRSystems Inc., Silver Spring, MD, USA). Spectral bandwidth was chosen in the equipment as 10 ± 1 nm and the dynamic range is 2–3 AU.
Near-infrared analyses were performed with (1,2,4)–Trichlorobenzene (TCB) and polypropylene (PP) powder. TCB is a solvent that is frequently used to carry out polypropylene analyses. TCB was provided by TEDIA Brasil (Rio de Janeiro, Brazil) as a high-purity HPLC grade and used as received. The polypropylene powder was produced in the lab with minimum purity of 99.5% and presented weight-average molecular weight of 982 × 103 g/gmol and average particle diameter of 365 µm.
Near-infrared readings were performed only after temperature stabilization. Eight replicates were obtained in all conditions and saved for standard error analyses. Initially, NIR spectra were collected for pure TCB at distinct temperatures, from 30 ℃ to 100 ℃ with a 10 ℃ interval. The temperature range was defined because PP analyses are usually performed in this temperature range. Then a full three-level factorial design was used for the simultaneous manipulation of temperature and stirring velocity in pure solvent experiments, at temperature levels of 30 ℃, 60 ℃, and 90 ℃ and stirring speed levels of 250, 350, and 450 rpm. Finally, a full three-level factorial design was also used for the simultaneous manipulation of temperature and stirring velocity in suspension experiments (2 g of PP in 400 mL of TCB), at temperature levels of 30 ℃, 60 ℃, and 90 ℃ and stirring speed levels of 250, 350, and 450 rpm.
Part 2: Experiments for Model Calibrations
Experiments performed for model calibration.
Results
Part 1
Variances
Near-infrared spectra for pure TCB were measured in the temperature range of 30–100 ℃ allowing for verification of the reproducibility of the experimental data. Near-infrared spectra for pure TCB can be found in the Supplemental Material. Absorption peaks at 800 nm, 1130 nm, and 1680 nm related to the third, second, and first overtones of the C–H stretching, respectively, could be observed. The spectral region of 2100–2300 nm was very noisy, containing information about combinations of overtones of the C–H stretching.21,22 It was noticed that the NIR spectra of pure TCB were not very sensitive to variations of stirring velocities and temperature, as one might already expect as the NIR spectra contains information about chemical bonds and molecular dynamics.1,21
Solid powder was introduced in the reaction media and its effect on spectral data was analyzed using NIR measurements. Near-infrared spectra for PP suspensions in TCB can be found in the Supplemental Material. Polypropylene (PP) suspensions in TCB increased measurement variability, which seems to depend on the particular analyzed spectral region. Besides, it also seems clear that measurement variability depends on the experimental condition, when spectra obtained at different temperatures and stirring speeds are compared to each other. Modification of spectral responses for suspensions of PP in TCB might already be expected, as NIR responses are sensitive to modification of the system composition and to particle sizes in heterogeneous polymer systems, due to scattering of light. 7 Variations of stirring velocity and temperature were imposed on PP suspensions in TCB media and analyses of the NIR spectra showed that stirring velocity affects measurement variability more significantly than temperature, which can be related to the fact that the stirring velocity changes the suspension characteristics and the frequency that particles cross the sampling window.
Variance spectra for pure TCB from 30 ℃ to 100 ℃ (variances of measured absorbances at distinct wavelengths) were calculated in the form:
(a) Absorbance variances of pure TCB at different stirring velocities at T = 30℃; (b) absorbance variances of the TCB/PP suspension (400 mL/2 g) at different temperatures at w = 450 rpm.
Variations of stirring velocity and temperature were imposed on the media for pure TCB and for PP suspension in TCB. Figure 1a and b shows the results for absorbance variances of pure TCB at different stirring velocities at T = 30 ℃ and absorbance variances of the TCB/PP suspension (400 mL/2 g) at different temperatures at w = 450 rpm, respectively. It can be noticed that the stirring speed and temperature also affect the reproducibility of the spectral measurement. Stirring velocity provides unavoidable mechanical vibration of the measuring system and formation of small air bubbles, as the stirring speed increases, which possibly justifies this behavior. In the presence of the solid, it has been verified that variances increase significantly.
As the information content of available measurements depend on the variances of measurement errors,
23
the obtained data clearly indicate that the information content of absorbance values measured at different wavelengths and experimental conditions depend on the particular conditions considered. Therefore, the matrix
Correlations
Figure 2 illustrates NIR measurement error correlations for some experimental conditions, as obtained for pure TCB and PP suspension in TCB and calculated as:
Correlations between absorptions: (a) 2220 nm and all of the others spectral measurements for pure TCB at T = 60 ℃ and w = 250 rpm and (b) 1200 nm and all of the others spectral measurements for TCB/PP (400 mL/2 g) at T = 30 ℃ and w = 250 rpm.
It can be noted that correlations between spectral measurements can be very high and very often essentially equal to 1, even when the NIR signals are very distant from each other in the wavelength scale. This means that
It can be also observed that strong positive correlations are related mostly to small unavoidable baseline variations. Besides, the strong positive correlations are also related do the slow modification of the absorbance spectra with the modification of the wavelength (or wave number), as deviations of the absorbance values at neighboring wavelengths do not change independently. On the other hand, strong negative correlations are observed mostly between absorbance values places at distinct regions of the spectrum (absorbance values at low and high wavelengths), which suggests fluctuations of the lamp or transmittance performance due to, for instance, small variations of the local temperature (especially at the lamp).
Part 2
Variances
Near-infrared spectra of pure xylene and of pure toluene at different temperatures and stirring speeds were obtained, showing absorption peaks placed at 870 nm, 1130 nm, 1680 nm, and 1767 nm, related, respectively, to the third and second overtones of the aromatic C–H stretching, combinations of overtones of aromatic C–H stretching, first overtone of aromatic C–H stretching, and first overtone of C–H stretching of the CH3 group.21,22 Near-infrared spectra of pure xylene and toluene can be found in the Supplemental Material. As observed previously for TCB, the spectral region of 2100–2300 nm is very noisy, containing information about combinations of overtones of the C–H stretching.21,22 It can be noticed that xylene and toluene spectra are very similar, making model calibration more difficult.
Solutions containing 40 wt% of xylene and 60 wt% of toluene have been chosen to analyze stirring and temperature effects. It could be observed that noise increases with temperature and stirring speeds, as observed previously for TCB, suggesting that similar effects can possibly be observed for other chemical systems. The effect of stirring speed and temperature in variance spectra of measurement errors has also been verified. As previously discussed, variances are sensitive to wavelength, temperature and stirring speeds and respond similarly to modifications of these variables, when compared to the results presented previously for TCB. Therefore, as observed before, the matrix
Covariances
Near-infrared measurement error correlations for some experimental conditions have been obtained and the results are presented in the Supplemental Material. Once more, it can be noted that correlations between spectral measurements can be very high and very often essentially equal to 1, even when the NIR signals are very distant from each other in the wavelength scale. As explained before, this means that
Standard Calibration Procedures
In order to analyze how model calibrations respond to the measurement errors, calibration models were built to provide the xylene content of the analyzed organic solution. As usual in this field, first and second derivative spectra were calculated in order to magnify the differences between toluene and xylene measurements and facilitate the calibration process, since this procedure can remove base line variations, remove measurement noise and discriminate overlapping bands. 24 Derivatives were computed with second-degree interpolating polynomials and five neighboring data points, simultaneously providing a smoothing effect. It is important to emphasize that the qualitative behavior of first-derivative spectra is very similar to the behavior of the crude spectra shown before, being sensitive to changes of temperature and stirring speeds and presenting variances and covariances that respond to changes of wavelengths, temperature, and stirring speeds as described before. In order to show that the use of standard pretreatment techniques do not change the overall behavior of the spectral variability, as discussed in the previous sections, available spectral data were treated with different standard pre-treatment techniques and used to compute the variance spectra, as shown in the Supplemental Material. As one can see, differences of at least one order of magnitude can be observed for computed variances in all cases.
Model calibration was performed with the help of MLR procedures implemented in the software Statistica 6.0.
25
In this case, the calibration model is defined as:

The performances of the calibration models were compared to each other considering four aspects: wavelength range, measurement conditions, input signal and objective function. Wavelengths were selected arbitrarily in the spectral regions where absorptions were more intense. Input signals included first-derivatives, second-derivatives, and ratios of signals. As an example, the effect of stirring velocity variation at 60 ℃ is presented in Figure 3 for a model built with first-derivatives at a single wavelength value of 2052 nm. Additional results for calibration model performances can be seen in the Supplemental Material.
Calibration model performance analyzing measurement condition effect for λ1 = 2052 nm and w from 250 rpm to 450 rpm at 60 ℃ using the least squares method.
It can be observed that model parameters (and model performances) changed considerably with the analyzed measurement conditions, due to variation of the NIR measurements with temperature and stirring velocity, indicating that these effects must be considered during the quantitative analysis. Moreover, it can be noted that model performances also changed with the spectral region, due to the different information contents of the distinct wavelength ranges, although the input signal did not affect the calibration performance significantly, as similar model performances could be obtained with different inputs. Additionally, model performances did not change with the objective functions in the analyzed case, due to the similar fluctuations of xylene and toluene concentration measurements in the analyzed concentration ranges.
Principal Directions
In the previous sections, it was observed that the spectral measurements in the NIR region are subject to measurement errors that are not uniform and depend on the measurement conditions. Besides, it was observed that measurement variability depends on the measurement conditions and on the spectral region and that fluctuations seem to respond to few common sources of error, since measurement correlations can be very high. For this reason, these effects were also taken into consideration during the quantitative calibration analysis of the xylene / toluene mixtures, in order to determine the xylene content based on the NIR readings.
The detailed presentation of heteroscedastic PCR and PLS procedures is beyond the scope of the present manuscript and can be found elsewhere.
26
However, it is important to say that homoscedastic procedures assume that measurements errors are uniform and independent in the experimental grid, so that the principal components are calculated as the eigenvectors of the matrix (
For the sake of quantitative analyses, principal directions were calculated with help of homoscedastic PCR (used as benchmark for comparison), heteroscedastic PCR and heteroscedastic PLS methods.
26
It is important to stress once more that homoscedastic procedures project the measured spectral data onto the subspace formed by the principal directions calculated with the covariance matrix of the full set of measured spectral data (
In order to analyze the
Principal directions with homoscedastic and heteroscedastic PCR procedures have been obtained, allowing verifying that calculated principal directions can be very different in both cases and that they change with the experimental conditions. This is not surprising, given the very different structures of the
Calibration Results
Based on the previous results, calibration models were built for xylene (and toluene) concentrations with homoscedastic PCR, heteroscedastic PCR, and PLS techniques using first-derivative and second-derivative spectra, as reported previously. Illustrative examples for models built with first-derivative spectra are presented in Figure 4.
(a) Homoscedastic PCR calibration at T = 90 ℃, w = 350 rpm; (b) heteroscedastic PCR calibration at T = 90 ℃, w = 350 rpm; and (c) PLS calibration at T = 90 ℃, w = 350 rpm.
It can be observed that the performances of calibration models built with homoscedastic and heteroscedastic PCR procedures are usually similar in the analyzed cases, despite the use of different principal components, although it seems that experimental fluctuations are more evident when model predictions are performed with the heteroscedastic PCR models. (It must be emphasized, though, that the use of the principal directions for modeling purposes with PCR techniques is based on heuristical assumptions, as it is not possible to assure formally that the directions that contain the highest variations of the independent variables are also the most influential ones in respect to the dependent variables.) On the other hand, calibrations performed with the heteroscedastic PLS technique led to the best model calibration performances. (This might already be expected, as PLS techniques are designed to provide the principal directions that allow for maximization of the correlation coefficients between measured and calculated results during model calibration). Perhaps more important than that, as experimental fluctuations were taken into consideration during model formulation, as required by Eq. 1, the obtained model performances are also compatible with the observed data variability. In this sense, one must observe in Figure 4c that all calibrations performed with the heteroscedastic PLS procedure provide predictions that fall inside the variation interval of available experimental measurements (as obtained with replicates). As a matter of fact, the heteroscedastic procedure is expected to provide more accurate predictions and simultaneously respect the statistical structure of the real measurement environment.
Conclusion
The present work presented a statistical study regarding NIR spectroscopy in two simple model problems: suspensions of polypropylene powder in (1,2,4)-trichlorobenzene and solutions of xylene and toluene. Near-infrared spectra were collected at distinct experimental conditions, through manipulation of compositions, temperature and stirring velocities. Replicates were used for computation of covariance matrices, showing that measurement variability changed with the experimental conditions and that NIR signals measured at distinct wavelengths were strongly correlated. For this reason, heteroscedastic modeling techniques based on principal components analysis (principal components regression and partial least squares) were used for calibration of model performances in the xylene / toluene problem, aiming at predicting the analyzed xylene concentrations. The results showed, therefore, that the assumption that the new set of linear variables is independent and uncorrelated is not correct when the spectral information (described by the variance spectra) is heteroscedastic and correlated. In other words, the intrinsic assumption of uniform experimental variability is not supported by the real experimental data. As a matter of fact, spectral measurements are subject to non-uniform disturbances, which vary with wavelength and measurement conditions, and we believe we have shown this clearly in the manuscript. As a consequence, model performance should not be expected to present uniform performance, as model deviations can be higher where experimental variations are also higher, which is neglected by standard procedures, that assume that model performances should be uniform in the measurement space. Experimental data show that spectral measurements at different wavelengths are strongly correlated, also suggesting the existence of few common error sources. In other words, NIR spectral measurements are subject to fluctuations and measurement errors that are not independent. It has been demonstrated in the present study that these effects can be considered during quantitative NIR data analyses.
The obtained results revealed that the principal directions were not preserved when the real covariance matrix of measurement errors was taken into account, affecting the calibration step significantly. Besides, calibration results obtained with the heteroscedastic PLS procedure provided more accurate predictions and simultaneously respected the statistical structure of the real measurement environment. Based on the obtained results, it seems clear that the intrinsic variability of NIR spectra must be characterized and used for modeling purposes in real NIR calibration problems.
Footnotes
Conflict of Interest
The authors report there are no conflicts of interest.
Funding
The authors thank CNPq (Conselho Nacional de Desenvolvimento Científico e Tecnológico), CAPES (Coordenação de Aperfeiçoamento de Pessoal de Nível Superior) and FAPERJ (Fundação Carlos Chagas Filho de Apoio à Pesquisa do Estado do Rio de Janeiro) for financial support and scholarships.
Supplemental Material
All supplemental material mentioned in the text, consisting of nine figures, is available in the online version of the journal.
