PNA
¹H qNMR and Chemometrics of Heirloom Apple Juices and Ciders · PNA-WP-CIDER v3.0

14. Chemometrics: PLS Regression of Composition on the Spectra

14.1 Purpose and design

The targeted procedure of Section 5.6 yields the composition, but it depends on line fitting, on a library of reference spectra and on a set of rules that must be maintained. A regression model that predicts the same quantities directly from a table of buckets would dispense with all of that, and it could be transferred to routine use more easily. PLS regression201 was therefore applied to the optimized buckets, with the pre-processing selected in Section 11, to predict the concentrations determined by qNMR. Models were built in three configurations: freeze-dried buckets against the non-volatile constituents measured in the same tubes; native buckets against ethanol, the volatile constituents, the sugars, the acids and the calculated energy; and native buckets against the polyols and minor acids, whose reference values come from the freeze-dried tube. One further model relates the native buckets to the alcohol content declared on the label. The number of latent variables, up to ten, was selected in an inner cross-validation, and the errors quoted are those of the outer, producer-grouped cross-validation (Table 19, Figure 45).

The meaning of these errors must be clear before the numbers are read. In the first two configurations the reference values were derived from the very spectra that serve as predictors. The model is then asked to reproduce a deterministic function of its input, and its error measures how well a linear combination of buckets imitates the targeted procedure, not how accurately the composition is known. Any bias of the reference values is inherited in full. Only the third configuration, in which predictor and reference come from different tubes and different acquisitions, and the model for the declared alcohol content are tests against independent information.

Table 19. PLS regression of the composition on optimized buckets (absolute intensities, mean-centered, Pareto-scaled): nested cross-validation grouped by producer. Concentrations in g/L unless stated otherwise.

Predicted quantitynRangeLatent variablesRMSECVRMSECV (% of mean)Q²RPDRPD, targeted integrals
Native buckets; reference values from the native tube (non-volatile constituents bridged from the freeze-dried tube)
Ethanol (% v/v)960.1–10.4100.0260.51.00059.442.7
Total sugar960–10281.25.10.99616.67.5
Sucrose960.0–42.9100.617150.99615.45.6
Glucose960.0–40.770.832110.9899.69.7
Fructose960.0–73.590.9057.50.99413.28.8
Malic acid960.0–7.3100.2478.80.9868.410.7
Lactic acid960.0–9.2100.287190.9807.27.6
Succinic acid960.0–1.5100.071150.9163.53.5
Acetic acid960.0–4.9100.094200.9879.010.9
Total organic acids961.9–13.9100.584100.9273.72.8
Energy (kcal per 12 fl oz)9635–24783.11.90.9909.96.7
Methanol (mg/L)960–2331025.9490.7982.23.8
Isoamyl alcohols (mg/L)960–232843.2360.2941.21.2
Sorbic acid (mg/L)960–2531065.11820.0821.01.9
Freeze-dried buckets; reference values from the same tubes
Total sugar870–10291.25.30.99616.413.9
Sucrose870.0–42.961.2290.9847.96.9
Glucose870.0–40.751.1140.9837.78.0
Fructose870.0–73.560.9918.50.99311.710.4
Malic acid870.0–7.3100.1535.50.99514.016.9
Lactic acid870.0–9.2100.1036.60.99820.740.3
Succinic acid870.0–1.5100.0439.40.9715.96.6
Citric acid870.0–3.3100.163850.9143.42.5
Quinic acid870.0–3.2100.155500.8212.42.0
Total organic acids871.9–13.9100.606100.9273.73.1
Glycerol870.0–6.2100.538180.7432.02.8
Sorbitol870.0–22.6100.3127.60.9878.82.2
1,3-Propanediol870.0–2.590.116630.9534.75.0
Total polyols871.8–25.8100.6829.30.9504.53.0
Native buckets; reference values from the freeze-dried tube (independent preparation and acquisition)
Total polyols871.8–25.8100.5707.80.9655.4–
Sorbitol870.0–22.6100.569140.9564.8–
Glycerol870.0–6.290.630210.6481.7–
1,3-Propanediol870.0–2.5100.176960.8923.1–
Citric acid870.0–3.3100.3281710.6531.7–
Quinic acid870.0–3.2100.3541140.0601.0–
Native buckets; reference value from the label
Declared ethanol (% v/v)714.2–11.010.672110.6621.7–

RMSECV, root mean square error of cross-validation; RPD, ratio of the standard deviation of the reference values to RMSECV. The last column gives the RPD of the corresponding model built on the table of targeted integrals.

14.2 Results

The principal constituents are reproduced with errors that are small against their range. Ethanol is predicted from the native buckets with a cross-validated error of 0.026 % v/v, total sugar with 1.2 g/L, sucrose with 0.62 g/L and the energy of a serving with 3.1 kcal; from the freeze-dried buckets, malic and lactic acids are predicted with 0.15 and 0.10 g/L and sorbitol with 0.31 g/L. The ratio of performance to deviation exceeds 7 for all of these, the range in which a model is conventionally regarded as fit for quantitative use.205 A second group, comprising succinic and acetic acids, the sums of acids and of polyols, 1,3-propanediol and citric acid, is predicted with ratios between 3 and 9, adequate for screening. For constituents whose signals are weak or buried the models are of little or no quantitative use: glycerol (Q² 0.74, ratio 2.0), quinic acid (0.82, 2.4) and methanol (0.80, 2.2) are predicted only roughly, and the isoamyl alcohols (Q² 0.29) and sorbic acid (0.08) not at all. A bucket 0.04 ppm wide that contains the methyl signal of a compound at 100 mg/L also contains the flank of a signal a hundred times larger, and Pareto scaling does not give such a bucket enough weight.

The comparison with the table of targeted integrals is instructive in both directions (last column of Table 19). Where a constituent has a window of its own, the integral table is equal or better; this holds for lactic and malic acids, and markedly for methanol and sorbic acid, whose small signals are isolated by the window. Where the integral table has no variable specific to a constituent, the buckets are far superior: sorbitol, which is hidden under the sugars and has no window, is predicted from buckets with a ratio of 8.8 and from integrals with 2.2, and sucrose and total sugar in the native tube behave in the same way. The untargeted representation thus recovers information from overlapped regions that fixed windows discard, while the targeted one protects small signals from large neighbors. Neither is uniformly better.

PLS regression on optimized buckets: cross-validated predictions against the reference values
Figure 45. PLS regression of composition on optimized buckets: cross-validated predictions against the reference values for twelve models. The first line of each title gives the predicted quantity, the second the tube that supplies the buckets and the source of the reference values. Marker shape and color indicate the measurement campaign.

The cross-tube models are the genuine test, and they show what can be obtained from the native spectrum alone. The sum of the polyols is predicted with an error of 0.57 g/L (ratio 5.4), sorbitol with 0.57 g/L (4.8) and 1,3-propanediol with 0.18 g/L (3.1). Glycerol by itself is predicted poorly (0.63 g/L, ratio 1.7), citric acid no better, and quinic acid not at all (Q² 0.06). The native spectrum therefore contains usable information on the total polyol content even though ethanol covers the polyol signals, presumably through the sorbitol signals between the ethanol multiplets and through the correlation of glycerol with ethanol. These models were applied to the nine ciders for which no freeze-dried tube exists (Table 20); the predicted polyol sums of 4 to 10 g/L would add 5 to 11 kcal per serving to the energy values reported for these ciders in Section 10.

Table 20. Polyols predicted from the native spectrum by PLS regression for the nine ciders without a freeze-dried tube (g/L), and the effect on the energy of a serving.

SampleCiderEthanol (% v/v)Sugar (g/L)Total polyols, predictedGlycerol, predictedSorbitol, predicted1,3-Propanediol, predictedEnergy without polyols (kcal)Energy with predicted polyols (kcal)
C026Hudson Valley Farmhouse Cider Bourbon Barrel Aged8.60.09.74.35.30.06177188
C032Nine Pin Cider Works Signature NY Hard Cider6.227.97.13.93.30.00168177
C038Downeast Original Blend, overpressurized can6.832.77.63.44.20.00187196
C039Downeast Original Blend, sound can6.051.87.63.24.40.00198207
C040Downeast Original Blend, Batch Y6.256.97.83.24.60.01209218
C043Awestruck Eastern Dry7.222.27.94.23.80.00180189
C083Angry Orchard Peach Mango4.733.34.42.41.90.02145150
C085Locust Grove Honey Crisp Cider (4-3-24)5.824.86.33.72.50.13156164
C086Locust Grove Peach Cider (4-3-24)5.50.05.13.41.80.00115121

Cross-validated errors of the models: total polyols 0.57 g/L, glycerol 0.63 g/L, sorbitol 0.57 g/L, 1,3-propanediol 0.18 g/L. Energy per 12 fl oz on the component basis; the last column adds glycerol and sorbitol as predicted individually.

The model for the declared alcohol content uses a single latent variable and has an error of 0.67 % v/v (Q² 0.66). This is the same as the standard deviation of the differences between qNMR and label found in Section 7.2. No model can predict the declarations better than the declarations describe the contents, and the result confirms that the scatter resides in the labels.

14.3 What the models have learned

The regression coefficients show that the models are chemically sensible (Figure 46). In each case the large coefficients lie on the signals of the constituent concerned: the methylene multiplet for malic acid, the methyl doublet and the methine quartet for lactic acid, the bucket at 3.84 ppm for sorbitol, the high-field methylene signals for glycerol, the two multiplets for ethanol, and the anomeric doublet together with the fructosyl signals for sucrose. The model for malic acid carries, in addition, negative coefficients on the downfield half of the citric acid quartet. It has learned the correction for the overlap of citric acid that the targeted procedure applies by rule. Coefficients of opposite sign on neighboring sugar buckets in the models for sorbitol, glycerol and sucrose serve the same purpose, the subtraction of overlapping contributions.

Regression coefficients of six PLS models against the centers of the buckets (5.8 to 0.7 ppm)
Figure 46. Regression coefficients of six PLS models against the centers of the buckets (5.8 to 0.7 ppm), with the assignment of the largest coefficients. Blue, positive; orange, negative. Each panel is scaled to its largest coefficient.

Two features of the models are to be kept in mind when they are used. The number of latent variables selected reached the permitted maximum of ten in 24 of the 36 bucket models, and the error was still falling at that point (Figure 38d). A regression against independent reference values would normally reach its optimum with fewer components and would then deteriorate; continued improvement is what is expected when the reference is an exact function of the predictors, and the errors of the first two configurations are to be read accordingly. Secondly, the models were validated by cross-validation grouped by producer, which protects against the recognition of a producer. Their transfer to another instrument, to other acquisition parameters or to another sample preparation calls for a verification with samples of known composition, as for any calibration. The predictions show no visible offset between the four campaigns (Figure 45), although these differ in acquisition parameters and, in part, in the spectrometer.

The practical conclusion is as follows. For the quantities that matter for dryness designation and nutrition labeling, namely alcohol, total sugar, the principal acids and energy, a PLS model on a bucket table is an adequate substitute for the targeted analysis once that analysis has provided the calibration. It is not a substitute for minor constituents, for additives, or for the recognition of anything unexpected, and it cannot improve on the accuracy of the values with which it was trained.