MCR Contrast Constraint and Faq more info on R Squared statistic: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
 
imported>Lyle
No edit summary
 
Line 1: Line 1:
This page discusses use of the contrast constraint for Multivariate Curve Resolution ([[Mcr|MCR]]) by Alternating Least Squares ([[als|ALS]]). More information on MCR can be found on the function pages discussing [[mcr|MCR]] and [[als|ALS]] as well as in the chemometrics tutorial.
===Issue:===


===Introduction===
Can you give me more information on the R-Squared statistic?


When resolving mixture data into pure component spectra and their contributions, a range of solutions are possible. In order to narrow down or eliminate some solutions, constraints are used in MCR. The requirement of positivity (non-negativity) is the most widely used constraint.
===Possible Solutions:===


The solution obtained from MCR is also influenced by the starting estimate. For example, when samples of the expected pure components are likely present in the data set, you initialize the MCR process with the "most pure" spectra available in the data set. This is done by having the MCR option "initmode" set to 1, for rows (the default). This selects the most pure samples to initialize the algorithm. In this way, you obtain resolved spectra with a maximum contrast.
R-Squared (R<sup>2</sup>) is an assessment of how well the model does the prediction (it is similar to RMSEC except that it doesn't show if there is a bias).  


Conversely, when pure variables (variables with contributions from only one of the components in the mixtures) are likely, for example in mass spectrometry, the option "initmode" can be changed to 2 (columns), leading to selection of more pure variables as an initial guess and, thus, maximum contrast in the spectra.
You can access the R<sup>2</sup> by right-clicking on a scores plot of predicted vs. measured. It is one of the items which show up in the information box ("Show on figure" puts it on the figure).  


The problem is that, even with the proper initialization and non-negativity constraints, the solution often does not show expected maximum contrast (in spectra or contributions). This is because there are still many possible solutions which meet the required criteria. This is often described as saying that the feasiable bounds of the problem are large. The "contrast" constraint can be used to help solve this problem and provide a more desired solution.
Note: in other software, R<sup>2</sup> is for the MODELED data only. In PLS_Toolbox we calculate it for the DISPLAYED data. That means that if you show excluded data, or if you show predicted/test data with calibration data ("Show Cal with Test") the R<sup>2</sup> will be for what is shown and will be different from the calibration data. Turn off the "Show Cal with Test" checkbox on the Plot Controls window to view the R<sup>2</sup> for only the test data.  


===Example of Use===
R<sup>2</sup> is calculated as the square of the correlation coefficient between the X and Y axes plotted in the figure. If the only data shown is the estimation of the calibration Y data vs. the actual calibration Y data, this is nearly the same as the standard R<sup>2</sup> for a model as defined by, e.g. Martens and Naes.


The contrast constraint can be demonstrated with energy dispersive X-ray spectrometry (EDS) of a sample described in Figure 1. For complete details about the new constraint and the data analysis example shown below (fully discussed in reference '''(1)''').


:[[File:c:\data\image\Picture1.jpg]]
'''Still having problems? Please contact our helpdesk at [mailto:helpdesk@eigenvector.com helpdesk@eigenvector.com]'''
:'''Figure 1.''' (a) An SEM image of the wires sample consisting of metal wires embedded in an epoxy matrix, together with the composition key. (b) The mean EDS spectrum computed from the data set. A 1024-channel spectrum was acquired each pixel in the 128-pixel x 128-pixel image (c) A single-pixel spectrum from the Cu/Mn/Ni wire.


In order to reduce to the noise and speed up calculations the data set was reduced image was calculated by averaging 3×3 block of pixels. The goal of MCR analysis is to discriminate the six alloys, which should lead to six resolved components with each a row of replicate samples. In other words, we want images (contributions with maximum contrast).  Analysis of this sample with MCR with its default settings results in 8 components: in addition to the six components there are two background components, see Figure 2 under MCR.
[[Category:FAQ]]
 
:
:'''Figure 2.''' The resolved images and spectra of regular MCR and of MCR with contribution contrast. The results are ordered to show the subsequent alloys.
 
Although 5 of the 6 images of the MCR results show single alloys, the first image is more complex. The highest contribution in the first image is Cu, the other two sets of replicates of alloys also contain a high amount of Cu: 83% an70%. Although this obviously reflects the proper relation between the samples it does not show the relation we want: single alloys. In order obtain maximum contrast MCR is called again with contrast option set to "a" (automatic).
 
As the results under image contrast show, this achieves the goal of separating the alloys. For more examples, including enhancing contrast in the resolved spectra, see reference '''(1)'''.
 
:'''(1)''' M.R. Keenan, “Multivariate Analysis of Spectral Images Composed of Count Data” in Techniques and applications of hyperspectral image analysis, H.F. Grahn and P.  Geladi, Eds (Wiley, Chichester, UK, 2007)  , pp. 89-126.
 
===Using Contrast in the Analysis Window===
 
To use the contrast option in the Analysis window, modify the Methods Options (see [[AnalysisWindow_Toolbar]] ) and choose either "s" (spectral contrast), "c" (contributions contrast), or "a" (automatic) for the <tt>alsoptions.contrast</tt> option.
 
===Using Contrast with Command-line Functions===
 
To use the contrast option from the Matlab command line with PLS_Toolbox, use the <tt>alsoptions.contrast</tt> option in [[MCR]] (or the <tt>contrast</tt> option in [[ALS]])
 
<pre>
>> options=mcr('options');
>> options.alsoptions.contrast='a';
</pre>
 
MCR will achieve contrast in the current initmode, which is 1.
 
 
===Algorithm===
 
When maximum contrast in spectra needs to be achieved, the angle between their vectors is maximal. So by manipulating angles, contrast can be achieved. The constraint works by adding small amounts of a unit vector to either the concentrations or the spectra, depending on which mode of contrast is desired. This has the effect of pushing the opposite mode's recovered components to have as big an angle as possilbe (be as different as possible = high contrast).

Latest revision as of 13:23, 2 January 2019

Issue:

Can you give me more information on the R-Squared statistic?

Possible Solutions:

R-Squared (R2) is an assessment of how well the model does the prediction (it is similar to RMSEC except that it doesn't show if there is a bias).

You can access the R2 by right-clicking on a scores plot of predicted vs. measured. It is one of the items which show up in the information box ("Show on figure" puts it on the figure).

Note: in other software, R2 is for the MODELED data only. In PLS_Toolbox we calculate it for the DISPLAYED data. That means that if you show excluded data, or if you show predicted/test data with calibration data ("Show Cal with Test") the R2 will be for what is shown and will be different from the calibration data. Turn off the "Show Cal with Test" checkbox on the Plot Controls window to view the R2 for only the test data.

R2 is calculated as the square of the correlation coefficient between the X and Y axes plotted in the figure. If the only data shown is the estimation of the calibration Y data vs. the actual calibration Y data, this is nearly the same as the standard R2 for a model as defined by, e.g. Martens and Naes.


Still having problems? Please contact our helpdesk at helpdesk@eigenvector.com