When developing a mixture of ingredients we use a to live some time to be sure that the mixture is fine and if we divide the mixed batch into several subsamples, the spectra of all the subsamples are similar each other in a certain level. If we see differences, we consider that the mixture is not completed and we can continue mixing. There is a point at a certain time where the mixture cannot be improve and after that point it can became worse to certain levels. We must be sure that we finish the mixture as closer to that point as possible.
If we get a library of spectra with those characteristics we can keep it and compare new batches in order to check if the spectrum at that time match with the spectra from the library.
In a mixture is also important that the quantities of every ingredient is correct, maybe we miss to add an ingredient, we add it in the wrong proportions, or by mistake an ingredient which does not form part of the formula. Why not to detect even a cross contaminant, or other issues.
If we develop a model based on good spectra, and prepare a realistic cutoff we can check all the batches and detect if the PASS or FAIL the Identification or Qualification Test.
There can be cases where we can know what the problem was looking to the spectra. One simple example is to add to a mixture an ingredient which should not be there... let´s suppose "Dextrose", and I acquire the spectrum of this mixture, after I subtract this spectrum from the average spectrum of all the good spectra in the library (let´s say the ideal spectrum)…..you will see how the difference spectrum is the Dextrose itself, or very similar with a high correlation to the samples in the Dextrose product.
You can see also this with more complex techniques as Principal Component Analysisn (PCAs), where we have a reconstructed spectrum and a residual spectrum as well. Can we see any features in the residual spectrum which tell us what is the ingredient or ingredients not explained by the model? Maybe is the spectra of an adulterant, wrong ingredient added by mistake,...