Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_mv_rot_promax (g03bd)

## Purpose

nag_mv_rot_promax (g03bd) calculates a ProMax rotation, given information following an orthogonal rotation.

## Syntax

[fp, r, phi, fs, ifail] = g03bd(stand, x, ro, power, 'n', n, 'm', m)
[fp, r, phi, fs, ifail] = nag_mv_rot_promax(stand, x, ro, power, 'n', n, 'm', m)

## Description

Let X$X$ and Y$Y$ denote n$n$ by m$m$ matrices each representing a set of n$n$ points in an m$m$-dimensional space. The X$X$ matrix is a matrix of loadings as returned by nag_mv_rot_orthomax (g03ba), that is following an orthogonal rotation of a loadings matrix Z$Z$. The target matrix Y$Y$ is calculated as a power transformation of X$X$ that preserves the sign of the loadings. Let Xij${X}_{ij}$ and Yij${Y}_{ij}$ denote the (i,j)$\left(i,j\right)$th element of matrices X$X$ and Y$Y$. Given a value greater than one for the exponent p$p$:
 Yij = δij ‖Xij‖p , $Yij = δij ‖Xij‖ p ,$
for
• i = 1,2,,n$i=1,2,\dots ,n$;
• j = 1,2,,m$j=1,2,\dots ,m$;
• δij =  { − 1 , if ​ Xij < 0 ; ​ 1 , otherwise.
${\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 , $XW=Y , X,Y ∈ ℝn×m , ​ W ∈ ℝm×m ,$
is found for W$W$ in the least squares sense by use of singular value decomposition of the orthogonal loadings X$X$. The ProMax rotation matrix R$R$ is then given by
 R = OW W̃ ,   O, ​ W̃ ∈ ℝm × m , $R=OW W~ , O, ​ W~ ∈ ℝm×m ,$
where O$O$ is the rotation matrix from an orthogonal transformation, and $\stackrel{~}{W}$ is a matrix with the square root of diagonal elements of (WTW)1${\left({W}^{\mathrm{T}}W\right)}^{-1}$ on its diagonal and zeros elsewhere.
The ProMax factor pattern matrix P$P$ is given by
 P = X W W̃ ,   P ∈ ℝn × m ; $P = X W W~ , P ∈ ℝn×m ;$
the inter-factor correlations Φ$\Phi$ are given by
 Φ = (QTQ) − 1 ,   Φ ∈ ℝm × m ; $Φ= (QT Q)-1 , Φ ∈ ℝm×m ;$
where Q = W$Q=W\stackrel{~}{W}$; and the factor structure S$S$ is given by
 S = PΦ ,   S ∈ ℝn × m . $S=PΦ , S ∈ ℝn×m .$
Optionally, the rows of target matrix Y$Y$ can be scaled by the communalities of loadings.

None.

## Parameters

### Compulsory Input Parameters

1:     stand – string (length ≥ 1)
stand = 'S'${\mathbf{stand}}=\text{'S'}$
Rows of Y$Y$ are (Kaiser) normalized by the communalities of the loadings.
stand = 'U'${\mathbf{stand}}=\text{'U'}$
Rows are not normalized.
Constraint: stand = 'U'${\mathbf{stand}}=\text{'U'}$ or 'S'$\text{'S'}$.
2:     x(ldx,m) – double array
ldx, the first dimension of the array, must satisfy the constraint ldxn$\mathit{ldx}\ge {\mathbf{n}}$.
The loadings matrix following an orthogonal rotation, X$X$.
3:     ro(ldro,m) – double array
ldro, the first dimension of the array, must satisfy the constraint ldrom$\mathit{ldro}\ge {\mathbf{m}}$.
The orthogonal rotation matrix, O$O$.
4:     power – double scalar
p$p$, the value of exponent.
Constraint: power > 1.0${\mathbf{power}}>1.0$.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array x.
n$n$, the number of points.
Constraint: nm${\mathbf{n}}\ge {\mathbf{m}}$.
2:     m – int64int32nag_int scalar
Default: The first dimension of the array ro and the second dimension of the arrays x, ro. (An error is raised if these dimensions are not equal.)
m$m$, the number of dimensions.
Constraint: m1${\mathbf{m}}\ge 1$.

### Input Parameters Omitted from the MATLAB Interface

ldx ldro ldfp ldr ldphi ldfs

### Output Parameters

1:     fp(ldfp,m) – double array
ldfpn$\mathit{ldfp}\ge {\mathbf{n}}$.
The factor pattern matrix, P$P$.
2:     r(ldr,m) – double array
ldrm$\mathit{ldr}\ge {\mathbf{m}}$.
The ProMax rotation matrix, R$R$.
3:     phi(ldphi,m) – double array
ldphim$\mathit{ldphi}\ge {\mathbf{m}}$.
The matrix of inter-factor correlations, Φ$\Phi$.
4:     fs(ldfs,m) – double array
ldfsn$\mathit{ldfs}\ge {\mathbf{n}}$.
The factor structure matrix, S$S$.
5:     ifail – int64int32nag_int scalar
${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see [Error Indicators and Warnings]).

## Error Indicators and Warnings

Errors or warnings detected by the function:
ifail = 1${\mathbf{ifail}}=1$
 On entry, stand ≠ 'U'${\mathbf{stand}}\ne \text{'U'}$ or 'S'$\text{'S'}$, or m < 1${\mathbf{m}}<1$, or power ≤ 1.0${\mathbf{power}}\le 1.0$.
ifail = 2${\mathbf{ifail}}=2$
 On entry, n < m${\mathbf{n}}<{\mathbf{m}}$, or ldx < n$\mathit{ldx}<{\mathbf{n}}$, or ldro < m$\mathit{ldro}<{\mathbf{m}}$, or ldfp < n$\mathit{ldfp}<{\mathbf{n}}$, or ldfs < n$\mathit{ldfs}<{\mathbf{n}}$, or ldr < m$\mathit{ldr}<{\mathbf{m}}$, or ldphi < m$\mathit{ldphi}<{\mathbf{m}}$.
ifail = 20${\mathbf{ifail}}=20$
An SVD decomposition failed to converge.
ifail = 100${\mathbf{ifail}}=100$
An internal error occurred in the calculations. Check array declarations and calls to nag_mv_rot_promax (g03bd). Please contact NAG.

## Accuracy

The calculations are believed to be stable.

None.

## Example

```function nag_mv_rot_promax_example
stand = 's';
x = [0.94072, -4e-05;
0.90419, 0.00055;
0.79085, 0.41509;
0.02255, 0.98874;
0.14625, 0.97499];
ro = [0.78895, 0.61446;
-0.61446, 0.78895];
power = 3;
[fp, r, phi, fs, ifail] = nag_mv_rot_promax(stand, x, ro, power)
```
```

fp =

0.9556   -0.0979
0.9184   -0.0935
0.7605    0.3393
-0.0791    1.0019
0.0480    0.9751

r =

0.7380    0.5420
-0.7055    0.8653

phi =

1.0000    0.2019
0.2019    1.0000

fs =

0.9358    0.0950
0.8995    0.0919
0.8290    0.4929
0.1232    0.9860
0.2448    0.9848

ifail =

0

```
```function g03bd_example
stand = 's';
x = [0.94072, -4e-05;
0.90419, 0.00055;
0.79085, 0.41509;
0.02255, 0.98874;
0.14625, 0.97499];
ro = [0.78895, 0.61446;
-0.61446, 0.78895];
power = 3;
[fp, r, phi, fs, ifail] = g03bd(stand, x, ro, power)
```
```

fp =

0.9556   -0.0979
0.9184   -0.0935
0.7605    0.3393
-0.0791    1.0019
0.0480    0.9751

r =

0.7380    0.5420
-0.7055    0.8653

phi =

1.0000    0.2019
0.2019    1.0000

fs =

0.9358    0.0950
0.8995    0.0919
0.8290    0.4929
0.1232    0.9860
0.2448    0.9848

ifail =

0

```