IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
rotatefactors2.m
Go to the documentation of this file.
1 %>@ingroup maths
2 %>@file
3 %>@brief Reproduces the factor rotation of Pirouette
4 %>
5 %> <h3>References</h3>
6 %> Pirouette (Informetrix Inc.) Help Documentation.
7 %
8 %> @param L
9 %> @param flag_normal
10 %> @param L
11 function L = rotatefactors2(L, flag_normal)
12 
13 if ~exist('flag_normal')
14  flag_normal = 0;
15 end;
16 
17 s = 'None';
18 if flag_normal
19  % Communality as defined in 5.39 of Pirouette.pdf (Pirouette User
20  % Guide). There is one communality measure for each row of the loadings
21  % matrix (i.e., each of the original features/wavenumbers).
22  h = sqrt(sum(L.^2, 2));
23 
24  for i = 1:size(L, 1)
25 % if h(i) ~= 0
26  L(i, :) = L(i, :)/(h(i)+realmin);
27 % end;
28  end;
29 
30  s = 'Normal';
31 end;
32 
33 L = rotatefactors(L, 'normalize', 'off');
34 
35 if flag_normal
36  for i = 1:size(L, 1)
37  L(i, :) = L(i, :)*h(i);
38  end;
39 end;
40 
41 disp(sprintf('INFO: Loadings were rotated (pre-processing: ''%s'').', s));
function rotatefactors2(in L, in flag_normal)
Pre-processing block base class.
Definition: pre.m:2
Analysis Session (AS) base class.
Definition: as.m:6