**5. Dimensionality Reduction by Principal Component Analysis**

Up to now, PCA has been applied to a datacube of experimental nominal transmittance spectra and has been used only to filter out noise in those spectra by reconstructing them with a small number *p* of PCs (in the cases studied here, *p* = 2). *Qg* and *Tg* have been retrieved by iterative fitting of the filtered spectra.

However, since filtered spectra are characterized by only *p* ∼ 2 PCs, it seems that it is very inefficient to perform fitting in the full spectral space (where our objects are vectors of *m* ∼ 15.000 components) instead of the subspace spanned by the relevant eigenvectors (where our objects are vectors of *p* components; we call this space "PC space").

The reason for this procedure is that simulation of spectra is based on the physics of absorption/emission and generates them line by line. So the spectra on which the iterative algorithm operates belong to the spectral space and have *m* components. If we want to operate in the PC space, they could be projected onto the *p* first eigenvectors obtained with PCA; then, the error between experiment and simulation could be calculated for the PCs. However, the bulk of the computation time is spent on the line-by-line simulation of the spectra and, once they are calculated, calculation of error is relatively straightforward. Thus, there is no appreciable efficiency gain in projecting the spectra on eigenvectors during iterative fitting and calculate errors in the PC space.
