4 - PARAFAC2
The PARAFAC2 model can be considered as an advanced variant of the normal PARAFAC1 model.
It handles slab-wise deviations between components in one mode as long as the cross-product of the components stays
reasonably fixed. This can be utilized for modeling chromatographic data with retention time shifts, modeling certain batch data of
varying length etc...
See Bro, Kiers & Andersson, Journal of Chemometrics,1999, 13, 295-309 for details on application
& Kiers, ten Berge & Bro, Journal of Chemometrics, 1999, 13, 275-294, for details on the algorithm
The PARAFAC2 model is given
Xk = A*Dk*(Pk*H)' + Ek, k = 1, .., K
Xk is a slab of data (I x J) in which J may actually vary with K.
K is the number of slabs.
A (I x F) are the scores or first-mode loadings.
Dk is a diagonal matrix that holds the k'th row of C in its diagonal.
C (K x F) is the third mode loadings.
H is an F x F matrix.
Pk is a J x F orthogonal matrix (J may actually vary from k to k).
The output here is given as a cell array of size J x F x K.
Thus, to get e.g. the second P write P(:,:,2), and to get the estimate of the second mode loadings at this
second frontal slab (k = 2), write P(:,:,2)*H.
The matrix Ek holds the residuals.
For a scientific overview of the method, click here.
IMPORTANT: Please read carefully the following notes before trying to compute a PARAFAC2 model.
- The common mode has to be the mode 1(for situation in which slabs are from different sizes).
It means that your data can be re-arranged in certain cases. According the following example, Mode 1 and Mode 2 can be inverted before computing the PARAFAC2 model.
This is necessary since the mode 1 has to be common
Please note that this situation can have an influence on the "Results" menu. Mode 1 would corresponds in this particular case to the spectra-loadings although in the original data, the mode 1 is the time.
And the same for the mode 2.
- If all slabs have similar size, X is an array: X(:,:,1) = X1; X(:,:,2) = X2; etc.(PARAFAC2 model is indeed also applicable with a "perfect" cube).
- If the slabs have different size X is a cell array: X{1} = X1; X{2} = X2; etc.
- Please note also that the Sample/Batch and the Variable user selection are not developed in this version of CuBatch (and consequently are not working).
Default labels are given on all graphs.
For mode 1: Var XX.
For mode 2: "name of the matrix"/Sam. XX
For mode 3: Mat. "name of the matrix"
- WARNING: Time of computation for PARAFAC2 models is sometimes quite huge. Do not worry !
1- When pressing the "PARAFAC2" button in the "Factor Analysis" menu, the user gets this window.
The field "Factors" corresponds to the number of factors for the PARAFAC2 model (Only one possible number, in opposition to the PARAFAC model).
Validation can be performed. If the user does not want cross-validation, then he has to click the proper field.
"Cross validation splitting in 7 segments" can also be performed by also clicking the proper field.
In the menu, "Preferences" opens an other window.
The user can choose between "best", "SVD" or "random" for initialisation.
A rather slow initialization method is used per default but it pays to investigate in avoiding local minima.
Experience may point to faster methods (set initialisation to SVD or random)
- Best is the best of 10 runs of maximally 80 iterations (default)
- SVD stands fo Singular Value Decomposition.
- Random gives random numbers for initialisation.
The "Iteration limits"(i.e. the maximum number of iterations) and the "Convergence criteria" are also parameters of the PARAFAC2 model that can be set through this window.
Coming back to the first window, the button "Set constraints" opens also a window.
Constraints can be imposed for first and the third mode. The second mode is not included because constraints
are not easily imposed in this mode
Available constraints are nonnegativity, orthogonality, unimodality (and nonnegativity).
By default, the PARAFAC2 model is performed without any constraints.
For more details about all constraints, see the proper literature.
References are mentionned above or here.