Function Repository Resource:

WhiteningTransform

Source Notebook

Transform data such that its covariance matrix is the identity matrix

Contributed by: Sander Huisman

ResourceFunction["WhiteningTransform"][data]

whitens data such that its covariance matrix is the identity matrix.

Details and Options

The whitening transform is sometimes called the sphering transformation.
data should be a list of vectors with equal length.
The number of data points should be more than the length of each vector, in other words, for N-dimensional data, at least N+1 data points are needed.
Using principal component analysis, data is transformed such that the covariance matrix of ResourceFunction["WhiteningTransform"][data] is the identity matrix.
ResourceFunction["WhiteningTransform"] takes a method option, with settings Automatic (default) and "SVD".
The Method "SVD" is generally more numerically stable, as it computes a singular value decomposition. So the covariance matrix is closer to an identity matrix. This is, in general, slower as compared to the default algorithm. Note that the different methods can cause the values to be multiplied -1 for each dimension: principal axes are only defined up to a constant.

Examples

Basic Examples (3) 

Show some original data:

In[1]:=
x = CompressedData["
1:eJwVm1c81f8fx42MbJG9Hcex916vs49z7LYkNCmpqF8pW1HRUKSykhUNDSFC
KElJipSGFElFZmX+z//qPL4353w/4/16PZ8XRzMozGcLHw8PzxA/D8//P/d4
iU80xjtB6LnT3kOayiB6JNKVQ9hQd3dIaA4yxum92+PvvqHDvr1dxmKOiIZf
b3et+UAFrTI9yeOfBszTlZ8fegM0BHVmvmvWRqfC/WGZQwzsi9n0zGWNAfSj
37DHzGhwrXx/7ethAm74rr4pN0jG3fVrlMt0pBGZ0as8uN8DKWdTlpNyLBHJ
KLzwvIOFD58vlDHGSPjTNCeSvsDC7X0bHJmRpghv4YhoybKhoT+4abm/GYwk
ijc2VLEQuHgSwjFmYNN/NDX8JeMrgzhrq6yFL5qKFw+qumOTjMRynyBzqJDC
SSc+A8ZK666Iy2kgbTu5hB3kgemKC4oPb1vixBCz6o0BFRQvFUVfd0VQPvi1
X3vFRuG2o0ttThhjDdGZFE2zwd/ayp51sYMuhgRp5cUwD5iZ33JgSVhjIWhL
lgjdFemmDm/kAkywMGznaRnlBkdmiIThbQuwLmOErE4F4clo9UEbIoy1KK2m
Szyg0qbuEKthDrW7p6J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fODpyMkbphAtNkzu8qRhlmy4+K2UhNyXwUaLBBZ+
LfBeWFAg4P2PUBVSgD12fzzwh1d+zMUlKvlfaT8DujJu2v4rdZH3WCzi1Hsr
0HcettmzKN2Qv/uJ3rIyB2w+oR+eTpOAnC6jqueeK/g8qlbYfjHHDbrag5o2
Gu6lbBRvUVBA4Mpegc9DLARSEpQEpfQQG2mTedyD26+E/fqZOyzgdSWzm9fU
BWLFet0SxUvxLlnplHoJkHzlznP5Lj4s5kSbKji44+LU0bVi5lbwCW3Zu/Qo
Gae0KsiRXP9nO51pEkxjQX27dTVPqwk4f+IopVzfc9a/4HvBxBBOOQ+0FTfQ
sSATGfgh2wATsbm1A1y/3hX9LcBwXgM5S6/7Ta1wQe7V7+ee7lfBfoGzGTKZ
VMyWOiqbdhExqfivyfwUEw7SDx8si9HF/wCnOOuN
"];
ListPlot[x, PlotRange -> All]
Out[2]=

Apply the whitening transform and show the result:

In[3]:=
o = ResourceFunction["WhiteningTransform"][x];
ListPlot[o, AspectRatio -> Automatic]
Out[4]=

Verify that the covariance matrix is an identity matrix (up to small numerical errors):

In[5]:=
Covariance[o] // Chop // MatrixForm
Out[5]=

Scope (2) 

Data can also be in higher dimensions:

In[6]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/aeaeecfa-6de9-4010-9ed2-0ad4e639e843"]
Out[7]=

Apply the transform:

In[8]:=
o = ResourceFunction["WhiteningTransform"][x];
ListPointPlot3D[o, BoxRatios -> Automatic]
Out[9]=

Verify that the covariance matrix is the identity matrix up to numerical error:

In[10]:=
Covariance[o] // Chop // MatrixForm
Out[10]=

Use the default method and the "SVD" method and check how far the covariance matrices deviate from the identity matrix:

In[11]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/7a2908c4-bc6c-40e3-aee6-01444659a5ef"]
Out[14]=

Neat Examples (4) 

Create some 6 dimensional correlated data and visualize it:

In[15]:=
BlockRandom[SeedRandom[12345];
  n = 400;
  feat = 6;
  {\[Mu], \[Sigma]} = {10, 2.5};
  X = RandomVariate[NormalDistribution[\[Mu], \[Sigma]], {n, feat}];
  scales = RandomSample[N[10^Subdivide[0, 2, feat - 1]]];
  scale = DiagonalMatrix[scales];
  theta = 0.5 Pi;
  rot = RotationMatrix[
    theta, {RandomReal[{-1, 1}, feat], RandomReal[{-1, 1}, feat]}];
  t = scale . rot;
  X = Map[# . t &, X]];
ParallelAxisPlot[X]
Out[16]=

Show the plots of 2D projections:

In[17]:=
Table[ListPlot[X[[All, {i, j}]], PlotRange -> All, ImageSize -> 80, AspectRatio -> 1, Axes -> False], {i, feat}, {j, feat}] // Grid[#, Frame -> All] &
Out[17]=

Whiten the data and visualize the output to verify that all off-diagonal plots are "sphered" and the diagonals are on a line:

In[18]:=
o = ResourceFunction["WhiteningTransform"][X];
Table[ListPlot[o[[All, {i, j}]], PlotRange -> All, ImageSize -> 80, Axes -> False, AspectRatio -> 1], {i, feat}, {j, feat}] // Grid[#, Frame -> All] &
Out[19]=

Verify that the covariance matrix is the identity matrix:

In[20]:=
Covariance[o] // Chop // MatrixForm
Out[20]=

Publisher

SHuisman

Version History

  • 1.0.0 – 26 May 2021

License Information