numpy.linalg.lstsq()

numpy.linalg.lstsq(a, b, rcond=-1) [source] Return the least-squares solution to a linear matrix equation. Solves the equation a x = b by computing a vector x that minimizes the Euclidean 2-norm || b - a x ||^2. The equation may be under-, well-, or over- determined (i.e., the number of linearly independent rows of a can be less than, equal to, or greater than its number of linearly independent columns). If a is square and of full rank, then x (but for round-off error) is the ?exact? soluti

numpy.linalg.LinAlgError

exception numpy.linalg.LinAlgError [source] Generic Python-exception-derived object raised by linalg functions. General purpose exception class, derived from Python?s exception.Exception class, programmatically raised in linalg functions when a Linear Algebra-related condition would prevent further correct execution of the function. Parameters: None Examples >>> from numpy import linalg as LA >>> LA.inv(np.zeros((2,2))) Traceback (most recent call last): File "<stdin&

numpy.linalg.inv()

numpy.linalg.inv(a) [source] Compute the (multiplicative) inverse of a matrix. Given a square matrix a, return the matrix ainv satisfying dot(a, ainv) = dot(ainv, a) = eye(a.shape[0]). Parameters: a : (..., M, M) array_like Matrix to be inverted. Returns: ainv : (..., M, M) ndarray or matrix (Multiplicative) inverse of the matrix a. Raises: LinAlgError If a is not square or inversion fails. Notes New in version 1.8.0. Broadcasting rules apply, see the numpy.linalg documentatio

numpy.linalg.eigvalsh()

numpy.linalg.eigvalsh(a, UPLO='L') [source] Compute the eigenvalues of a Hermitian or real symmetric matrix. Main difference from eigh: the eigenvectors are not computed. Parameters: a : (..., M, M) array_like A complex- or real-valued matrix whose eigenvalues are to be computed. UPLO : {?L?, ?U?}, optional Same as lower, with ?L? for lower and ?U? for upper triangular. Deprecated. Returns: w : (..., M,) ndarray The eigenvalues in ascending order, each repeated according to its mult

numpy.linalg.eigvals()

numpy.linalg.eigvals(a) [source] Compute the eigenvalues of a general matrix. Main difference between eigvals and eig: the eigenvectors aren?t returned. Parameters: a : (..., M, M) array_like A complex- or real-valued matrix whose eigenvalues will be computed. Returns: w : (..., M,) ndarray The eigenvalues, each repeated according to its multiplicity. They are not necessarily ordered, nor are they necessarily real for real matrices. Raises: LinAlgError If the eigenvalue computatio

numpy.linalg.eigh()

numpy.linalg.eigh(a, UPLO='L') [source] Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix. Returns two objects, a 1-D array containing the eigenvalues of a, and a 2-D square array or matrix (depending on the input type) of the corresponding eigenvectors (in columns). Parameters: a : (..., M, M) array Hermitian/Symmetric matrices whose eigenvalues and eigenvectors are to be computed. UPLO : {?L?, ?U?}, optional Specifies whether the calculation is done with the l

numpy.linalg.eig()

numpy.linalg.eig(a) [source] Compute the eigenvalues and right eigenvectors of a square array. Parameters: a : (..., M, M) array Matrices for which the eigenvalues and right eigenvectors will be computed Returns: w : (..., M) array The eigenvalues, each repeated according to its multiplicity. The eigenvalues are not necessarily ordered. The resulting array will be of complex type, unless the imaginary part is zero in which case it will be cast to a real type. When a is real the result

numpy.linalg.det()

numpy.linalg.det(a) [source] Compute the determinant of an array. Parameters: a : (..., M, M) array_like Input array to compute determinants for. Returns: det : (...) array_like Determinant of a. See also slogdet Another way to representing the determinant, more suitable for large matrices where underflow/overflow may occur. Notes New in version 1.8.0. Broadcasting rules apply, see the numpy.linalg documentation for details. The determinant is computed via LU factorization us

numpy.linalg.cond()

numpy.linalg.cond(x, p=None) [source] Compute the condition number of a matrix. This function is capable of returning the condition number using one of seven different norms, depending on the value of p (see Parameters below). Parameters: x : (..., M, N) array_like The matrix whose condition number is sought. p : {None, 1, -1, 2, -2, inf, -inf, ?fro?}, optional Order of the norm: p norm for matrices None 2-norm, computed directly using the SVD ?fro? Frobenius norm inf max(sum(abs(x), a

numpy.linalg.cholesky()

numpy.linalg.cholesky(a) [source] Cholesky decomposition. Return the Cholesky decomposition, L * L.H, of the square matrix a, where L is lower-triangular and .H is the conjugate transpose operator (which is the ordinary transpose if a is real-valued). a must be Hermitian (symmetric if real-valued) and positive-definite. Only L is actually returned. Parameters: a : (..., M, M) array_like Hermitian (symmetric if all elements are real), positive-definite input matrix. Returns: L : (..., M