# NAG FL Interfaceg03bdf (rot_​promax)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

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

## 2Specification

Fortran Interface
 Subroutine g03bdf ( n, m, x, ldx, ro, ldro, fp, ldfp, r, ldr, phi, fs, ldfs,
 Integer, Intent (In) :: n, m, ldx, ldro, ldfp, ldr, ldphi, ldfs Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: x(ldx,m), ro(ldro,m), power Real (Kind=nag_wp), Intent (Inout) :: fp(ldfp,m), r(ldr,m), phi(ldphi,m), fs(ldfs,m) Character (1), Intent (In) :: stand
#include <nag.h>
 void g03bdf_ (const char *stand, const Integer *n, const Integer *m, const double x[], const Integer *ldx, const double ro[], const Integer *ldro, const double *power, double fp[], const Integer *ldfp, double r[], const Integer *ldr, double phi[], const Integer *ldphi, double fs[], const Integer *ldfs, Integer *ifail, const Charlen length_stand)
The routine may be called by the names g03bdf or nagf_mv_rot_promax.

## 3Description

Let $X$ and $Y$ denote $n×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 $1$ 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}$
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
 $Φ= (QTQ)-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.

## 5Arguments

1: $\mathbf{stand}$Character(1) Input
${\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: $\mathbf{n}$Integer Input
On entry: $n$, the number of points.
Constraint: ${\mathbf{n}}\ge {\mathbf{m}}$.
3: $\mathbf{m}$Integer Input
On entry: $m$, the number of dimensions.
Constraint: ${\mathbf{m}}\ge 1$.
4: $\mathbf{x}\left({\mathbf{ldx}},{\mathbf{m}}\right)$Real (Kind=nag_wp) array Input
On entry: the loadings matrix following an orthogonal rotation, $X$.
5: $\mathbf{ldx}$Integer Input
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: $\mathbf{ro}\left({\mathbf{ldro}},{\mathbf{m}}\right)$Real (Kind=nag_wp) array Input
On entry: the orthogonal rotation matrix, $O$.
7: $\mathbf{ldro}$Integer Input
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: $\mathbf{power}$Real (Kind=nag_wp) Input
On entry: $p$, the value of exponent.
Constraint: ${\mathbf{power}}>1.0$.
9: $\mathbf{fp}\left({\mathbf{ldfp}},{\mathbf{m}}\right)$Real (Kind=nag_wp) array Output
On exit: the factor pattern matrix, $P$.
10: $\mathbf{ldfp}$Integer Input
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: $\mathbf{r}\left({\mathbf{ldr}},{\mathbf{m}}\right)$Real (Kind=nag_wp) array Output
On exit: the ProMax rotation matrix, $R$.
12: $\mathbf{ldr}$Integer Input
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: $\mathbf{phi}\left({\mathbf{ldphi}},{\mathbf{m}}\right)$Real (Kind=nag_wp) array Output
On exit: the matrix of inter-factor correlations, $\Phi$.
14: $\mathbf{ldphi}$Integer Input
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: $\mathbf{fs}\left({\mathbf{ldfs}},{\mathbf{m}}\right)$Real (Kind=nag_wp) array Output
On exit: the factor structure matrix, $S$.
16: $\mathbf{ldfs}$Integer Input
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: $\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).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-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{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{m}}\ge 1$.
On entry, ${\mathbf{power}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{power}}>1.0$.
On entry, ${\mathbf{stand}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{stand}}=\text{'U'}$ or $\text{'S'}$.
${\mathbf{ifail}}=2$
On entry, ${\mathbf{ldfp}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldfp}}\ge {\mathbf{n}}$.
On entry, ${\mathbf{ldfs}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldfs}}\ge {\mathbf{n}}$.
On entry, ${\mathbf{ldphi}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldphi}}\ge {\mathbf{m}}$.
On entry, ${\mathbf{ldr}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldr}}\ge {\mathbf{m}}$.
On entry, ${\mathbf{ldro}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldro}}\ge {\mathbf{m}}$.
On entry, ${\mathbf{ldx}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldx}}\ge {\mathbf{n}}$.
On entry, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge {\mathbf{m}}$.
${\mathbf{ifail}}=20$
The singular value decomposition has failed to converge. This is an unlikely error exit.
${\mathbf{ifail}}=100$
An internal error has occurred in this routine. Check the routine call and any array sizes. If the call is correct then please contact NAG for assistance.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

## 7Accuracy

The calculations are believed to be stable.

## 8Parallelism and Performance

g03bdf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g03bdf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
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 implementation-specific information.

None.

## 10Example

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

### 10.1Program Text

Program Text (g03bdfe.f90)

### 10.2Program Data

Program Data (g03bdfe.d)

### 10.3Program Results

Program Results (g03bdfe.r)