Programmer Guide/Command Reference/EVAL/svd: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 28: Line 28:
|
|
|}
|}
:;Result 1: The transformed matrix ''T''.
;Result 1: The transformed matrix ''T''.
----
----
;Usage 2: '''<code>svd('''1''', <var>A</var>, <var>trn</var>)</code>'''
;Usage 2: '''<code>svd('''1''', <var>A</var>, <var>trn</var>)</code>'''
:;Result 2: Returns the matrix ''C''=<code>trn(''T'')*''T''</code>. ''C'' is a square matrix with M rows and columns (MxM).
;Result 2: Returns the matrix ''C''=<code>trn(''T'')*''T''</code>. ''C'' is a square matrix with M rows and columns (MxM).
----
----
;Usage 3: '''<code>svd('''2''', <var>A</var>, <var>trn</var>, <var>U</var>, <var>S</var>, <var>V</var>)</code>'''
;Usage 3: '''<code>svd('''2''', <var>A</var>, <var>trn</var>, <var>U</var>, <var>S</var>, <var>V</var>)</code>'''
Line 37: Line 37:
:;<var>S</var>:contains on return the vector ''S'' with M elements; Note: the returned vector contains the diagonal elements of the matrix &Sigma;, which are called the ''singular values''.
:;<var>S</var>:contains on return the vector ''S'' with M elements; Note: the returned vector contains the diagonal elements of the matrix &Sigma;, which are called the ''singular values''.
:;<var>V</var>:contains on return the MxM matrix ''V''
:;<var>V</var>:contains on return the MxM matrix ''V''
;Result: Computes the SVD of the transformed input matrix ''T''. The results are stored in the (optional) numerical tables (references) ''U'' (NxM), ''S'' (Mx1, diagonal of &Sigma;) and ''V'' (MxM). The return value ''PC'' is the matrix <code>''PC''=''U'' * ''S''</code>.
;Result 3: Computes the SVD of the transformed input matrix ''T''.  
:<code>solve: ''T'' = ''U'' * &Sigma; * trn(''V'')</code>
::<code>solve: ''T'' = ''U'' * &Sigma; * trn(''V'')</code>
:The results are stored in the (optional) numerical tables (references) ''U'' (NxM), ''S'' (Mx1, diagonal of &Sigma;) and ''V'' (MxM). The return value is the NxM matrix <code>''PC''=''U'' * &Sigma;</code>.
----
----





Revision as of 09:36, 21 April 2011

Compute the variance, covariance or covariance-matrix.


Usage 1
svd(0, A, trn)
A
the NxM matrix to be transformed
trn
transformation to be applied to A
trn transformed matrix T (NxM) description trn(T)*T
(MxM)
0 T[i,j] = A[i,j] no transformation "Streumatrix"
1 T[i,j] = A[i,j]-avr(A) subtract matrix mean
2 T[i,j] = A[i,j]-avr(A[*,j]) subtract column mean (center columns) covariance matrix
3 T[i,j] = (A[i,j]-avr(A[*,j]))/dev(A[*,j]) subtract column mean, devide by column deviation (center and standardize columns) correlation matrix
4 T[i,j] = A[i,j]-(avr(A[i,*])+avr(A[*,j]))+avr(A) subtract row and column mean, add matrix mean (center rows and columns)
Result 1
The transformed matrix T.

Usage 2
svd(1, A, trn)
Result 2
Returns the matrix C=trn(T)*T. C is a square matrix with M rows and columns (MxM).

Usage 3
svd(2, A, trn, U, S, V)
U
contains on return the NxM matrix U
S
contains on return the vector S with M elements; Note: the returned vector contains the diagonal elements of the matrix Σ, which are called the singular values.
V
contains on return the MxM matrix V
Result 3
Computes the SVD of the transformed input matrix T.
solve: T = U * Σ * trn(V)
The results are stored in the (optional) numerical tables (references) U (NxM), S (Mx1, diagonal of Σ) and V (MxM). The return value is the NxM matrix PC=U * Σ.


See also
var, corr, dist, haclust, modclust

<function list>

Navigation menu

Personal tools