Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Rotation choices

The rotation between marginal steps does not change where RBIG ends, but it sets how many layers the loop needs, and some rotations never get there

02 · Rotation choices

Open In Colab

Every RBIG layer ends in a rotation, and notebook 00 already showed that the choice matters: with PCA rotations the loop stalled on two moons, with random rotations it did not. By (3) a layer removes the marginal divergence its rotation exposes, so a rotation that turns the remaining dependence into non-Gaussian marginals converges fast, and one that exposes nothing stalls. We compare the four rotations of rbig on three datasets, counting the layers each needs to pass the projection test (3).

Python implementation: CPython
Python version       : 3.13.12
IPython version      : 9.12.0

numpy       : 2.4.3
scipy       : 1.17.1
matplotlib  : 3.11.2
scikit-learn: 1.8.0
rbig        : 0.1.16
picard      : 0.8.2

Compiler    : Clang 21.1.4 
OS          : Linux
Release     : 6.8.0-1044-azure
Machine     : x86_64
Processor   : x86_64
CPU cores   : 16
Architecture: 64bit

1. The yardstick and the rotations

We measure how Gaussian the state is with the projection test of notebook 00: the largest Kolmogorov–Smirnov distance to N(0,1)\mathcal{N}(0, 1) over J=64J = 64 unit directions ej\vect{e}_j, here drawn uniformly on the sphere so that the test works in any dimension. A loop has converged when the statistic is below its 95% quantile on standard-normal samples of the same size.

The statistic and its null quantile follow.

Two of the rotations need care. rbig.ICARotation and rbig.PicardRotation fit Picard’s whitening matrix K\mat{K} and unmixing W\mat{W} Ablin et al., 2018, and in their default orthogonal mode they apply W\mat{W} without the rotation part of K\mat{K}, which puts W\mat{W} in the wrong frame. That is a bug in rbig (rbig#159), worked through in Part 2. Until it is fixed we apply the orthogonal rotation WUKVK⊤\mat{W} \mat{U}_K \mat{V}_K^\top ourselves, where K=UKdiag(⋅)VK⊤\mat{K} = \mat{U}_K \mathrm{diag}(\cdot) \mat{V}_K^\top.

One layer fits the marginal step and the rotation to the current state. We compare five rotations: PCA, a fresh random rotation in every layer, rbig’s orthogonal ICA as it is, ICA with the corrected frame, and rbig’s Picard rotation with the corrected frame.

The layer applies the fitted rotation, through transform for the first three kinds and through the corrected matrix for the last two.

The loop runs fifteen layers and records the projection statistic after each.

Two small helpers read the first layer at which a trace passes the test, and run every rotation on a dataset.

2. A correlated Gaussian

The first dataset is four correlated Gaussian coordinates, standardised.

PCA         passes at layer 2   KS_max after 15 layers 0.017
random      passes at layer 13  KS_max after 15 layers 0.022
ICA (rbig)  passes at layer 10  KS_max after 15 layers 0.018
ICA         passes at layer 8   KS_max after 15 layers 0.016
Picard      passes at never     KS_max after 15 layers 0.112
null 95% quantile 0.039

PCA passes after two layers: its first rotation decorrelates the Gaussian, which makes the coordinates independent, and the second marginal step only rescales them. Random rotations take thirteen layers to stumble on the same result. ICA has nothing to find, because a decorrelated Gaussian looks the same in every orthogonal frame and has no non-Gaussian direction, so its rotation is arbitrary; it passes after eight layers with the corrected frame and ten without. The Picard rotation never passes, for a reason section 5 explains.

3. Rotated independent sources

The second dataset is the one ICA is made for: four independent unit-variance sources, two uniform (lighter tails than a Gaussian, sub-Gaussian) and two Laplace (heavier, super-Gaussian), rotated by a fixed random orthogonal matrix. The data are white, so PCA has no variance differences to align with.

PCA         passes at layer 2   KS_max after 15 layers 0.022
random      passes at layer 4   KS_max after 15 layers 0.025
ICA (rbig)  passes at layer 3   KS_max after 15 layers 0.039
ICA         passes at layer 2   KS_max after 15 layers 0.021
Picard      passes at never     KS_max after 15 layers 0.051
null 95% quantile 0.040

ICA with the corrected frame passes after two layers: its first rotation recovers the sources, which the second marginal step makes Gaussian. On this draw PCA does as well, random rotations need four layers and rbig’s orthogonal ICA as it is needs three, because its rotation misses the sources. The Picard rotation stays above the threshold. One draw is a thin basis for ranking rotations that differ by a layer or two, so we repeat the run on five fresh draws of the sources and their rotation, for eight layers each.

draw 1: PCA layer 4, random layer 3, ICA (rbig) never, ICA layer 2, Picard never
draw 2: PCA layer 4, random layer 5, ICA (rbig) layer 5, ICA layer 2, Picard never
draw 3: PCA layer 3, random layer 7, ICA (rbig) layer 6, ICA layer 2, Picard never
draw 4: PCA layer 4, random layer 2, ICA (rbig) layer 7, ICA layer 2, Picard layer 2
draw 5: PCA layer 5, random layer 7, ICA (rbig) layer 8, ICA layer 2, Picard never

ICA with the corrected frame passes at layer two on every draw. PCA needs three to five layers, random rotations two to seven, and rbig’s orthogonal ICA as it is five to eight or never. The Picard rotation passes on one draw in five.

4. Two moons

The third dataset is the two moons of notebook 00, whose dependence is curved, so no single rotation removes it.

PCA         passes at never     KS_max after 15 layers 0.055
random      passes at layer 11  KS_max after 15 layers 0.042
ICA (rbig)  passes at never     KS_max after 15 layers 0.160
ICA         passes at layer 4   KS_max after 15 layers 0.019
Picard      passes at never     KS_max after 15 layers 0.148
null 95% quantile 0.040
<Figure size 1500x420 with 3 Axes>

Figure 1:The projection statistic KS_max after each of fifteen RBIG layers, for five rotations on three datasets; the loop has converged once the statistic is below the grey line, its 95% quantile on standard-normal data. PCA wins on the correlated Gaussian and stalls on two moons; ICA with the corrected frame ties with PCA on the rotated sources and wins on two moons; rbig’s orthogonal ICA as it is and rbig’s Picard rotation stall on two moons.

On two moons PCA stalls above the threshold, as in notebook 00, and random rotations first pass after eleven layers and end on the threshold. ICA with the corrected frame first passes after four, hovers near the threshold until layer ten and ends at half of it: after a marginal step the moons are a cloud with a few non-Gaussian directions, and ICA turns them onto the axes, where the next marginal step removes them. rbig’s orthogonal ICA as it is and the Picard rotation both stall far from Gaussian, worse than PCA. We look at where four of the loops are after fifteen layers.

<Figure size 1500x400 with 4 Axes>

Figure 2:Two moons after fifteen RBIG layers with four rotations. PCA and rbig’s orthogonal ICA as it is have each stalled on a shape of arms; random rotations leave faint arms; ICA with the corrected frame is close to a round cloud, with faint bands left.

5. ICA and Picard

rbig.ICARotation and rbig.PicardRotation call the same solver, picard.picard Ablin et al., 2018, with orthogonal constraints; they differ only in the options they pass, so Picard is not a different, faster ICA here.

The option that matters is extended. Picard’s extended=True lets each component be sub-Gaussian or super-Gaussian, and the solver turns it on by default when the rotation is orthogonal. rbig.ICARotation keeps that default, but rbig.PicardRotation passes extended=False, which assumes every source is super-Gaussian. We fit both to two uniform sources, which are sub-Gaussian, with the full unmixing WK\mat{W} \mat{K}, so the frame bug plays no part, and score the separation with the Amari index, which is 0 for a perfect separation and grows towards 1 as the unmixing misses.

We compare ICARotation, PicardRotation with its default and PicardRotation with extended=True.

ICARotation               Amari index 0.014
PicardRotation            Amari index 0.977
PicardRotation, extended  Amari index 0.014

With its default the Picard rotation does not separate the uniform sources at all, and with extended=True it matches ICARotation. A bimodal projection, which two moons have after a marginal step, is sub-Gaussian too. We rerun the loop on two moons with the Picard rotation, extended=True and the corrected frame, and compare it with ICA.

largest difference from the ICA trace 0.0e+00
KS_max after 15 layers 0.019

The two loops agree layer for layer, so on two moons the default extended=False is the whole reason the Picard rotation stalled. That is a defect in rbig (rbig#163): picard turns extended on by default for orthogonal rotations, and rbig.PicardRotation overrides it. Until it is fixed, pass extended=True, or use ICARotation.

Recap

RotationFindsCorrelated GaussianRotated sourcesTwo moons
PCAvariance axes2 layers2 to 5 layersstalls
randomnothing (Haar)13 layers2 to 7 layers11 layers, borderline
rbig orthogonal ICA as it iswrong frame (rbig#159)10 layers3 to 8 layers, or stallsstalls
ICA, corrected frameindependent axes8 layers2 layers4 layers, clear by 11
rbig.PicardRotation, defaultsuper-Gaussian axes onlystallsstalls on five draws of sixstalls

The layer counts are from one draw of the correlated Gaussian and of two moons, and six draws of the rotated sources, with a projection test at the 95% level. PCA is the right rotation when the dependence is Gaussian, ICA when it comes from non-Gaussian sources or curved structure, and a random rotation is the slow, fit-free choice that always gets there.

Next. Every loop here used rbig’s empirical marginal step. The next notebook looks at what happens at the edges of its support.

References
  1. Ablin, P., Cardoso, J.-F., & Gramfort, A. (2018). Faster Independent Component Analysis by Preconditioning with Hessian Approximations. IEEE Transactions on Signal Processing, 66(15), 4040–4049.