Faq PARALIND in PLS Toolbox

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search

Issue:

Can I do PARALIND in PLS_Toolbox?

Possible Solutions:

It is indeed possible to do PARALIND. PARALIND is essentially a PARAFAC model where some component matrices are constrained such that there are linear dependencies. For example, in PARALIND it may be specified that while the score matrix has five columns (five components), component one and three should be identical. Or component four should be equal to the sum of component one to three. Such constraints can be added in PARALIND and PLS_Toolbox allows to implement constraints in all modes. The following code exemplifies how it is possible to do PARALIND.

% Load amino acid EEM fluorescence data as example
% PARALIND is not needed for these data, so this is just an example

>>load aminoacids

% Define dependency in mode two. The actual loadings will be
% a set of three vectors multiplied by H_B

>>H_B = [1 0 1;0 0 1;0 1 0]; % Dependency in mode 2

% Likewise for mode three, but note that H_C is 2*3. Therefore,
% mode three loadings are really defined as a two (not three) column
% matrix multiplied by H_C. In this particular case, the second
% row of H_C defines that loading two and three must be identical for
% this model

>>H_C = [1 0 0;0 1 1]; % dependency in mode 3

% Define PARAFAC to do PARALIND in two modes

>>opt = parafac('options');
>>opt.constraints{2}.type = 'rightprod';
>>opt.constraints{3}.type = 'rightprod';

% Set the actual dependency matrices

>>opt.constraints{2}.advanced.linearconstraints.matrix = H_B;
>>opt.constraints{3}.advanced.linearconstraints.matrix = H_C;

% Fit the model

>>model = parafac(X,3,opt);

% Plot the three loadings in mode three slightly shifted
% and see that two of them are identical

>>close
>>plot(model.loads{3}*diag([1 1 1.01];


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