File Exchange

image thumbnail

Data Dimension Reduction

version 1.0.0.0 (1.25 KB) by Michael Kleder
Transforms vector data into a subspace of one less dimension, along direction of smallest extent.

4 Downloads

Updated 14 Jul 2005

No License

DIMRED - Data Dimension Reduction. Linearly transforms vector data into a subspace of one less dimension. Compresses data along the (arbitrary) direction of smallest spatial extent.

[D,R,T] = dimred(X)

X = Original vector data. Each row is a data point. Each column is a dimension in the original space.
D = Reduced vector data. Each row is a data point. Each column is a dimension in the lower-dimensional space.
R = "rotation" matrix to convert data from the the reduced space back into the original data space (for example, after performing operations on the data in the lower-dimensional space). Convert D back to X by using X = D*R+T;
T = "translation" matrix to convert data from the the reduced space back into the original data space (for example, after performing operations on the data in the lower-dimensional space). Convert D back to X by using X = D*R+T;

NOTES:
(1) The narrowest dimension of the data is compressed to zero. No attempt is made to verify that this is prudent. The user may wish to compute a dimensionality ratio r such as
g = svd(X); r = min(g) / max(g);
or,
g = abs(eig(cov(X))); r = min(g)/max(g);
and then proceed if r < 1e-6, for example.
(2) To convert some function F of D back to a function G of X
in the higher dimnensional space as follows:
X = (original data)
[D,R,T] = dimred(X);
F = (result of some presumably linear operation perfomed on D)
G = F*R+T;
(3) ver 1.0, Michael Kleder, July 2005

Cite As

Michael Kleder (2020). Data Dimension Reduction (https://www.mathworks.com/matlabcentral/fileexchange/7993-data-dimension-reduction), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

sanyukta

when I run the code why does it shows an error as:

Undefined function or method 'dimred' for input arguments of type 'double'.

Error in ==> Untitled at 26
[D,R,T]=dimred(X);

The Author

The corection has been uploaded.

The Author

The very first line of this file was accidentally commented out. Please remove the % at the very beginning of the file. It will then perform correctly. (A corrected version has been posted and will be available soon.)

Updates

1.0.0.0

The function declaration line was accidentally commented out in the original submission.

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux