Saturday, April 28, 2018

Continuing Review of Rescal.py


In rescal.py [1]:

Line 155:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.tocoo.html


Line 165 - 166:

S = S + X[i].T
S = S + X[i]

https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html

https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html


https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.T.html

Line 167:


_, A = eigsh(csr_matrix(S, dtype=dtype, shape=(n, n)), rank)

The left side (_,A) seems to be in the form: eigenvalues, eigenvectors .
What is this??

Looking at:

Schneider, Hans;  Barker, George P. "Matrices and Linear Alegbra"




gives:

pg. 240
==========================================
(a) Let A be an nxn matrix. Then the scalar lambda is an eigenvalue of A if and only if (A - lamba*I) is singular.

(b) Let x be a nonzero column vector in C{sub:n,1} (insert: complex vector of n rows and 1 column). Then x is called an eigenvector belonging to (or associated with) the eigenvalue
lamba if an only if (A - lambda*I)*x = 0.
By Corollary (2.7.3) there is a non-zero vector x such that (A - Ilambda*I)x = 0 if and only if A - lambda*I is singular
===========================================
pg. 25
===========================================
(1.4.3) Definition: The square matrix A is termed nonsingular if and only if A posesses an inverse. If A has no inverse , A is called singular.
===========================================
pg. 240 (cont)
Hence lambda is an eigenvalue if and only if for some nonzero x, Ax = lamba*x . Observe that for an eigenvector x of A, Ax is a scalar multiple of x. Thus amd eigenvector of A is a vector whose direction is not changed when multiplied by A, although its magnitude may change. (when lambda is complex, this requires a careful defintion of direction).


https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.eigsh.html

https://docs.scipy.org/doc/scipy/reference/tutorial/arpack.html


https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html

https://docs.python.org/2/tutorial/datastructures.html

https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html


[1] https://github.com/mnick/rescal.py/blob/master/rescal/rescal.py

line 173

Z = _updateZ(A, P, lmbdaV)
R = _updateR(X, A, lmbdaR)

https://shahriar.svbtle.com/underscores-in-python









No comments:

Post a Comment