Let
$\Lambda $ be the
$p$ by
$k$ matrix of loadings from a variabledirected multivariate method, e.g., canonical variate analysis or factor analysis. This matrix represents the relationship between the original
$p$ variables and the
$k$ orthogonal linear combinations of these variables, the canonical variates or factors. The latter are only unique up to a rotation in the
$k$dimensional space they define. A rotation can then be found that simplifies the structure of the matrix of loadings, and hence the relationship between the original and the derived variables. That is, the elements,
${\lambda}_{ij}^{*}$, of the rotated matrix,
${\Lambda}^{*}$, are either relatively large or small. The rotations may be found by minimizing the criterion:
where the constant
$\gamma $ gives a family of rotations with
$\gamma =1$ giving varimax rotations and
$\gamma =0$ giving quartimax rotations.
It is generally advised that factor loadings should be standardized, so that the sum of squared elements for each row is one, before computing the rotations.
The matrix of rotations,
$R$, such that
${\Lambda}^{*}=\Lambda R$, is computed using first an algorithm based on that described by
Cooley and Lohnes (1971), which involves the pairwise rotation of the factors. Then a final refinement is made using a method similar to that described by
Lawley and Maxwell (1971), but instead of the eigenvalue decomposition, the algorithm has been adapted to incorporate a singular value decomposition.

1:
$\mathbf{stand}$ – Character(1)
Input

On entry: indicates if the matrix of loadings is to be row standardized before rotation.
 ${\mathbf{stand}}=\text{'S'}$
 The loadings are row standardized.
 ${\mathbf{stand}}=\text{'U'}$
 The loadings are left unstandardized.
Constraint:
${\mathbf{stand}}=\text{'S'}$ or $\text{'U'}$.

2:
$\mathbf{g}$ – Real (Kind=nag_wp)
Input

On entry: $\gamma $, the criterion constant with $\gamma =1.0$ giving varimax rotations and $\gamma =0.0$ giving quartimax rotations.
Constraint:
${\mathbf{g}}\ge 0.0$.

3:
$\mathbf{nvar}$ – Integer
Input

On entry: $p$, the number of original variables.
Constraint:
${\mathbf{nvar}}\ge {\mathbf{k}}$.

4:
$\mathbf{k}$ – Integer
Input

On entry: $k$, the number of derived variates or factors.
Constraint:
${\mathbf{k}}\ge 2$.

5:
$\mathbf{fl}\left({\mathbf{ldfl}},{\mathbf{k}}\right)$ – Real (Kind=nag_wp) array
Input/Output

On entry: $\Lambda $, the matrix of loadings.
${\mathbf{fl}}\left(\mathit{i},\mathit{j}\right)$ must contain the loading for the $\mathit{i}$th variable on the $\mathit{j}$th factor, for $\mathit{i}=1,2,\dots ,p$ and $\mathit{j}=1,2,\dots ,k$.
On exit: if
${\mathbf{stand}}=\text{'S'}$, the elements of
fl are standardized so that the sum of squared elements for each row is
$1.0$ and then after the computation of the rotations are rescaled; this may lead to slight differences between the input and output values of
fl.
If
${\mathbf{stand}}=\text{'U'}$,
fl will be unchanged on exit.

6:
$\mathbf{ldfl}$ – Integer
Input

On entry: the first dimension of the arrays
fl and
flr as declared in the (sub)program from which
g03baf is called.
Constraint:
${\mathbf{ldfl}}\ge {\mathbf{nvar}}$.

7:
$\mathbf{flr}\left({\mathbf{ldfl}},{\mathbf{k}}\right)$ – Real (Kind=nag_wp) array
Output

On exit: the rotated matrix of loadings, ${\Lambda}^{*}$.
${\mathbf{flr}}\left(\mathit{i},\mathit{j}\right)$ will contain the rotated loading for the $\mathit{i}$th variable on the $\mathit{j}$th factor, for $\mathit{i}=1,2,\dots ,p$ and $\mathit{j}=1,2,\dots ,k$.

8:
$\mathbf{r}\left({\mathbf{ldr}},{\mathbf{k}}\right)$ – Real (Kind=nag_wp) array
Output

On exit: the matrix of rotations, $R$.

9:
$\mathbf{ldr}$ – Integer
Input

On entry: the first dimension of the array
r as declared in the (sub)program from which
g03baf is called.
Constraint:
${\mathbf{ldr}}\ge {\mathbf{k}}$.

10:
$\mathbf{acc}$ – Real (Kind=nag_wp)
Input

On entry: indicates the accuracy required. The iterative procedure of
Cooley and Lohnes (1971) will be stopped and the final refinement computed when the change in
$V$ is less than
${\mathbf{acc}}\times \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1.0,V\right)$. If
acc is greater than or equal to
$0.0$ but less than
machine precision or if
acc is greater than
$1.0$,
machine precision will be used instead.
Suggested value:
$0.00001$.
Constraint:
${\mathbf{acc}}\ge 0.0$.

11:
$\mathbf{maxit}$ – Integer
Input

On entry: the maximum number of iterations.
Suggested value:
$30$.
Constraint:
${\mathbf{maxit}}\ge 1$.

12:
$\mathbf{iter}$ – Integer
Output

On exit: the number of iterations performed.

13:
$\mathbf{wk}\left(2\times {\mathbf{nvar}}+{\mathbf{k}}\times {\mathbf{k}}+5\times \left({\mathbf{k}}1\right)\right)$ – Real (Kind=nag_wp) array
Workspace


14:
$\mathbf{ifail}$ – Integer
Input/Output

On entry:
ifail must be set to
$0$,
$1$ or
$1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value
$1$ or
$1$ is recommended. If message printing is undesirable, then the value
$1$ is recommended. Otherwise, the value
$0$ is recommended.
When the value $\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit:
${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see
Section 6).
If on entry
${\mathbf{ifail}}=0$ or
$1$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
 ${\mathbf{ifail}}=1$

On entry, ${\mathbf{acc}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{acc}}\ge 0.0$.
On entry, ${\mathbf{g}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{g}}\ge 0.0$.
On entry, ${\mathbf{k}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{k}}\ge 2$.
On entry, ${\mathbf{ldfl}}=\u2329\mathit{\text{value}}\u232a$ and ${\mathbf{nvar}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{ldfl}}\ge {\mathbf{nvar}}$.
On entry, ${\mathbf{ldr}}=\u2329\mathit{\text{value}}\u232a$ and ${\mathbf{k}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{ldr}}\ge {\mathbf{k}}$.
On entry, ${\mathbf{maxit}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{maxit}}>0$.
On entry, ${\mathbf{nvar}}=\u2329\mathit{\text{value}}\u232a$ and ${\mathbf{k}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{nvar}}\ge {\mathbf{k}}$.
On entry, ${\mathbf{stand}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{stand}}=\text{'S'}$ or $\text{'U'}$.
The accuracy is determined by the value of
acc.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementationspecific information.
If the results of a principal component analysis as carried out by
g03aaf are to be rotated, the loadings as returned in the array
p by
g03aaf can be supplied via the argument
fl to
g03baf. The resulting rotation matrix can then be used to rotate the principal component scores as returned in the array
v by
g03aaf. The routine
f06yaf may be used for this matrix multiplication.
This example is taken from page 75 of
Lawley and Maxwell (1971). The results from a factor analysis of ten variables using three factors are input and rotated using varimax rotations without standardizing rows.