Getting Started with Indirect Hard Modeling

This is a tutorial for PEAXACT - Software for Quantitative Spectroscopy from S-PACT. Its main objective is to get you familiar with one of the powerful spectra analysis methods: Indirect Hard Modeling (IHM). The tutorial addresses to PEAXACT users and persons interested in PEAXACT.

In this tutorial you learn how to:

  1. Create a Hard Model using IHM
  2. Calibrate the model
  3. Use the model to predict concentrations of unknown spectra

If you have PEAXACT installed on your computer you may try this tutorial right away. If you don't have PEAXACT yet, get a free trial now.

Preparations

You can find data of this tutorial in %ProgramFiles%\S-PACT\PEAXACT 5\Data\Raman - Mixing. The directory will be referred to as DATA in the following.

  • Start PEAXACT.
  • Choose File > New Session > Raman from the menu which opens a new modelling session with Raman default settings.

Pure Component Modeling

The first step is to create a new Hard Model for each pure component.

  • Load the table file which contains the data used for modelling. Choose Data > Load Table from the menu and browse to DATA\References. Select the Excel file DataTablePureComponents.xls and continue, which will load pure component spectra of cyclohexane, dioxane, and toluene.
  • Select Cyclohexane.csv#1 in the Samples Panel.
  • Now, there a several ways to create a new Hard Model for the selected sample. For pure components, the easiest way is to right-click in the Samples Panel and choose New Hard Model for Active Sample from the context menu. This automatically creates a new model, containing a Hard Model with a Hard Model Component named after the sample.
  • Choose Edit Model > Hard Model > Add & Autofit Peaks from the menu.
  • Enter 11 and continue. Hard Model Peaks will always be added to the Hard Model's first component. You can always add more peaks if needed.
  • Choose File > Save Model from the menu to save the model as Cyclohexane.pxm.
  • Select the next sample and repeat the model building steps above for each component. You may need a different number of peaks in order to fit the data well.
Component# Peaks
Cyclohexane11
Dioxane15
Toluene16
Recommended number of peaks to be fitted to each component spectrum
  • Your resulting pure component model for toluene might look like this now. Note that it is still fitted to the Toluene spectrum you used for modeling, displaying the fit residuals below the main plot.

Mixture Modeling

The second step is to create the hard model of the mixture by combining pure component models from before.

  • Choose File > New Model from the menu.
  • Choose Edit Model > Hard Model > Import Components from the menu. You will be notified that a new Hard Model is added to the model.
  • Browse to the location where you saved the pure component models, select all three model files and continue. Hard Model Components are imported/copied to the new model.
  • Choose File > Save Model from the menu and save the mixture model.

Congratulations - you have successfully created your first mixture Hard Model. Whenever you apply this Hard Model to a mixture spectrum - e.g. when performing Component Fitting from the Analysis menu - you will experience how the flexibility of the Hard Model helps to determine the correct contributions (Component Weights) of the three components to the mixture. We will skip this step here because it will automatically happen during the next step - the calibration of the model.

Calibrate the Model

In order to calibrate the model, you need to provide reference concentrations for some mixture spectra. You can either enter reference values using the PEAXACT Data Table Editor or import reference values from an Excel file. We will do the latter...

  • Choose Data > Load Table... from the menu, browse to DATA\References and select DataTableCalibration.xls to load 8 mixture spectra.
  • Select all mixture samples in the Samples Panel.
  • Choose Edit Model > Calibration Model > New... from the menu which opens the calibration setup dialog. Select a Hard Model (HM) Regression as calibration method (should be selected automatically).
  • Let's assume we are interested in Dioxane only, so select Dioxane [mol/mol] as the only feature for calibration. For HM Regression, you have to link each feature to a Hard Model Component. If the model's component names match the feature names, components are linked automatically.
  • Allow cubic as a maximum function for the regression. This will calculate polynomial regression functions up to a degree of 3 (i.e. cubic), and you will be able to select the most suitable one - simple, linear, quadratic or cubic - later. Disregard the cross-validation settings for now; as we have independent test samples, we're in a much more convenient situation anyway. Click OK to start calibration.
  • What happens now, when the progress bar says "Processing sample..."? Well, the Hard Model needs to be fitted to all selected samples and Component Weights are calculated (remember: the spectral contribution of each component present in the spectrum). Next, dioxane's Component Weight is regressed to the given mole fraction with polynomials up to cubic. Correct - it is the Calibration Curve.
  • Calibration results are displayed in a Report Window. You can switch between different reports (top-right drop-down list) to evaluate the alternatives and finally select the most suitable one in the bottom-right table. Don't forget to look at least into RMSE vs. Function, Calibration Curve, and Predicted vs. True. The two latter ones allow you to see the performance of the alternative polynomial functions by selecting it from the Function drop-down list.
  • Once you made your choice on a specific regression function in the bottom-right table, click OK to accept it.
  • Finally, choose File > Save Model from the main window's menu to save the model.

Probably you are not extremely happy with the performance of the Calibration Model, especially for the test samples marked in blue in the reports. Actually, this is not surprising since we are calibrating mole fractions in a non-ideal mixture... we expect it to cause trouble. But do we have a way out?

We do. Fortunately, all samples have a constant sum of concentrations (here 1), and that allows us to use the regression option ratios. For experts: this incorporates the mass balance into the regression problem.

  • Select the previously calibrated model in the Model Tree Panel and choose File > Duplicate from the menu.
  • Re-calibrate the model clone by the same procedure as just described, but this time choose the following options during calibration setup:
    • enable all three features
    • link each to the correct Hard Model Component
    • choose ratios for regression variables
  • Note that ratios fixes the regression function to simple, so after confirming the dialog with OK you won't have any choice of regression functions - take it or leave it! However, evaluating e.g. the Predicted vs. True plot should convince you that ratios is the better choice. The Calibration Model now even extrapolates dioxane correctly from the calibrated concentration range (0.1 - 0.25) to 0.4 and higher!

Analysis

It is now time to analyze some unknown spectra.
  • Choose Data > Load Samples..., browse to DATA\Analysis and select all files to load additional 8 mixture spectra. These have similar concentrations as the training samples, but they were measured with different settings on another day.
  • Select the new samples in the Samples Panel and choose Analysis > Prediction from the menu.
  • When finished, predicted concentrations are displayed in a Report Window. You can now evaluate the results in the different reports and export them by clicking the Export button. What you see is what you export!
Whew - that's the fast ride to get your first calibrated Hard Model done! Get yourself a fresh cup of coffee and continue with the other learning materials from the PEAXACT Quick Start page!
 

SPACT GmbH

Burtscheider Str. 1
52064 Aachen
Tel.: +49 241 - 9569 9812
Fax: +49 241 - 4354 4308
E-Mail:
Internet: www.s-pact.de