G03BDF (PDF version)
G03 Chapter Contents
G03 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentG03BDF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

G03BDF calculates a ProMax rotation, given information following an orthogonal rotation.

## 2  Specification

 SUBROUTINE G03BDF ( STAND, N, M, X, LDX, RO, LDRO, POWER, FP, LDFP, R, LDR, PHI, LDPHI, FS, LDFS, IFAIL)
 INTEGER N, M, LDX, LDRO, LDFP, LDR, LDPHI, LDFS, IFAIL REAL (KIND=nag_wp) X(LDX,M), RO(LDRO,M), POWER, FP(LDFP,M), R(LDR,M), PHI(LDPHI,M), FS(LDFS,M) CHARACTER(1) STAND

## 3  Description

Let $X$ and $Y$ denote $n$ by $m$ matrices each representing a set of $n$ points in an $m$-dimensional space. The $X$ matrix is a matrix of loadings as returned by G03BAF, that is following an orthogonal rotation of a loadings matrix $Z$. The target matrix $Y$ is calculated as a power transformation of $X$ that preserves the sign of the loadings. Let ${X}_{ij}$ and ${Y}_{ij}$ denote the $\left(i,j\right)$th element of matrices $X$ and $Y$. Given a value greater than one for the exponent $p$:
 $Yij = δij Xij p ,$
for
• $i=1,2,\dots ,n$;
• $j=1,2,\dots ,m$;
• ${\delta }_{ij}=\left\{\begin{array}{c}-1\text{, if ​}{X}_{ij}<0\text{; ​}\\ 1\text{, otherwise.}\end{array}\right\$
The above power transformation tends to increase the difference between high and low values of loadings and is intended to increase the interpretability of a solution.
In the second step a solution of:
 $XW=Y , X,Y ∈ ℝn×m , ​ W ∈ ℝm×m ,$
is found for $W$ in the least squares sense by use of singular value decomposition of the orthogonal loadings $X$. The ProMax rotation matrix $R$ is then given by
 $R=OW W~ , O, ​ W~ ∈ ℝm×m ,$
where $O$ is the rotation matrix from an orthogonal transformation, and $\stackrel{~}{W}$ is a matrix with the square root of diagonal elements of ${\left({W}^{\mathrm{T}}W\right)}^{-1}$ on its diagonal and zeros elsewhere.
The ProMax factor pattern matrix $P$ is given by
 $P = X W W~ , P ∈ ℝn×m ;$
the inter-factor correlations $\Phi$ are given by
 $Φ= QT Q-1 , Φ ∈ ℝm×m ;$
where $Q=W\stackrel{~}{W}$; and the factor structure $S$ is given by
 $S=PΦ , S ∈ ℝn×m .$
Optionally, the rows of target matrix $Y$ can be scaled by the communalities of loadings.
None.

## 5  Parameters

1:     STAND – CHARACTER(1)Input
On entry: indicates how loadings are normalized.
${\mathbf{STAND}}=\text{'S'}$
Rows of $Y$ are (Kaiser) normalized by the communalities of the loadings.
${\mathbf{STAND}}=\text{'U'}$
Rows are not normalized.
Constraint: ${\mathbf{STAND}}=\text{'U'}$ or $\text{'S'}$.
2:     N – INTEGERInput
On entry: $n$, the number of points.
Constraint: ${\mathbf{N}}\ge {\mathbf{M}}$.
3:     M – INTEGERInput
On entry: $m$, the number of dimensions.
Constraint: ${\mathbf{M}}\ge 1$.
4:     X(LDX,M) – REAL (KIND=nag_wp) arrayInput
On entry: the loadings matrix following an orthogonal rotation, $X$.
5:     LDX – INTEGERInput
On entry: the first dimension of the array X as declared in the (sub)program from which G03BDF is called.
Constraint: ${\mathbf{LDX}}\ge {\mathbf{N}}$.
6:     RO(LDRO,M) – REAL (KIND=nag_wp) arrayInput
On entry: the orthogonal rotation matrix, $O$.
7:     LDRO – INTEGERInput
On entry: the first dimension of the array RO as declared in the (sub)program from which G03BDF is called.
Constraint: ${\mathbf{LDRO}}\ge {\mathbf{M}}$.
8:     POWER – REAL (KIND=nag_wp)Input
On entry: $p$, the value of exponent.
Constraint: ${\mathbf{POWER}}>1.0$.
9:     FP(LDFP,M) – REAL (KIND=nag_wp) arrayOutput
On exit: the factor pattern matrix, $P$.
10:   LDFP – INTEGERInput
On entry: the first dimension of the array FP as declared in the (sub)program from which G03BDF is called.
Constraint: ${\mathbf{LDFP}}\ge {\mathbf{N}}$.
11:   R(LDR,M) – REAL (KIND=nag_wp) arrayOutput
On exit: the ProMax rotation matrix, $R$.
12:   LDR – INTEGERInput
On entry: the first dimension of the array R as declared in the (sub)program from which G03BDF is called.
Constraint: ${\mathbf{LDR}}\ge {\mathbf{M}}$.
13:   PHI(LDPHI,M) – REAL (KIND=nag_wp) arrayOutput
On exit: the matrix of inter-factor correlations, $\Phi$.
14:   LDPHI – INTEGERInput
On entry: the first dimension of the array PHI as declared in the (sub)program from which G03BDF is called.
Constraint: ${\mathbf{LDPHI}}\ge {\mathbf{M}}$.
15:   FS(LDFS,M) – REAL (KIND=nag_wp) arrayOutput
On exit: the factor structure matrix, $S$.
16:   LDFS – INTEGERInput
On entry: the first dimension of the array FS as declared in the (sub)program from which G03BDF is called.
Constraint: ${\mathbf{LDFS}}\ge {\mathbf{N}}$.
17:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ or ​}1$ is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ 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).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=1$
 On entry, ${\mathbf{STAND}}\ne \text{'U'}$ or $\text{'S'}$, or ${\mathbf{M}}<1$, or ${\mathbf{POWER}}\le 1.0$.
${\mathbf{IFAIL}}=2$
 On entry, ${\mathbf{N}}<{\mathbf{M}}$, or ${\mathbf{LDX}}<{\mathbf{N}}$, or ${\mathbf{LDRO}}<{\mathbf{M}}$, or ${\mathbf{LDFP}}<{\mathbf{N}}$, or ${\mathbf{LDFS}}<{\mathbf{N}}$, or ${\mathbf{LDR}}<{\mathbf{M}}$, or ${\mathbf{LDPHI}}<{\mathbf{M}}$.
${\mathbf{IFAIL}}=20$
An SVD decomposition failed to converge.
${\mathbf{IFAIL}}=100$
An internal error occurred in the calculations. Check array declarations and calls to G03BDF. Please contact NAG.

## 7  Accuracy

The calculations are believed to be stable.

None.

## 9  Example

This example reads a loadings matrix and calculates a varimax transformation before calculating $P$, $R$ and $\sigma$ for a ProMax rotation.

### 9.1  Program Text

Program Text (g03bdfe.f90)

### 9.2  Program Data

Program Data (g03bdfe.d)

### 9.3  Program Results

Program Results (g03bdfe.r)

G03BDF (PDF version)
G03 Chapter Contents
G03 Chapter Introduction
NAG Library Manual