Questions tagged [matrix-decomposition]

In the mathematical discipline of linear algebra, a matrix decomposition or matrix factorization is a factorization of a matrix into a product of matrices.

In the mathematical discipline of linear algebra, a matrix decomposition or matrix factorization is a factorization of a matrix into a product of matrices.

In numerical analysis, different decompositions are used to implement efficient matrix algorithms.

94 questions
8
votes
2 answers

How to generate a Rank 5 matrix with entries Uniform?

I want to generate a rank 5 100x600 matrix in numpy with all the entries sampled from np.random.uniform(0, 20), so that all the entries will be uniformly distributed between [0, 20). What will be the best way to do so in python? I see there is an…
Galen BlueTalon
  • 173
  • 4
  • 20
7
votes
2 answers

Shaken faith in `qr()`

I have relied on the qr() function a lot in dealing with rank-deficient situations, but have recently run into some examples where it doesn't work correctly. Consider the matrix badX below: badX <- structure(c(-1.641906809157e-10, 0, 0, 0, 0, -0.5,…
Russ Lenth
  • 5,922
  • 2
  • 13
  • 21
7
votes
0 answers

Eigen3 Sparse Solver noncopyable

iam working on a numerical code and want to evaluate how Sparse and Dense Matrix-LU decomposition (and later others as well) differ for the usecase of the code. Eigens Dense Decomposition Objects can be copyable, and that is used to cache these,…
jonas_toth
  • 872
  • 5
  • 8
6
votes
1 answer

Correct use of pivot in Cholesky decomposition of positive semi-definite matrix

I don't understand how to use the chol function in R to factor a positive semi-definite matrix. (Or I do, and there's a bug.) The documentation states: If pivot = TRUE, then the Choleski decomposition of a positive semi-definite x can be computed.…
Ian
  • 1,062
  • 1
  • 9
  • 21
6
votes
2 answers

Solve linear equation system by given LU decomposition and vector of constants

Given L and U LU decomposition and vector of constants b such that LU*x=b , is there any built in function which find the x ? Mean something like - X = functionName(L,U,b) Note that in both L and U we are dealing with triangular matrices which…
URL87
  • 10,667
  • 35
  • 107
  • 174
5
votes
2 answers

CHOLMOD in Java

I asked already something similar, but this time I will be more specific. I need to perform, within a for loop, the Cholesky factorization of a generally large positive definite symmetrix matrix (about 1000x1000). Now, to do this, I have been giving…
fpe
  • 2,700
  • 2
  • 23
  • 47
4
votes
1 answer

SciPy generalized eigenvalues: eig and eigh yield different results

Using scipy, I want to compute a generalized eigenvalue problem (see this link). In my case, matrix A is symmetric and real, albeit not positive definite (it doesnt need to be afaik). Matrix B is real, symmetric and positive definite. Thus, both…
4
votes
1 answer

Eigendecomposition makes me wonder in numpy

I test the theorem that A = Q * Lambda * Q_inverse where Q the Matrix with the Eigenvectors and Lambda the Diagonal matrix having the Eigenvalues in the Diagonal. My code is the following: import numpy as np from numpy import linalg as…
user8270077
  • 4,621
  • 17
  • 75
  • 140
4
votes
1 answer

Why does LU decomposition using Parallel.For not work?

I am trying to solve LU decomposition with the Doolittle Algorithm – according to this document. Without parallelization, code works fine. However, I would like to make this code run in parallel - trying to make a parallel outer and two inner loops.…
4
votes
1 answer

chol() function in R keeps returning Upper Triangular (I need Lower Triangular)

I am trying to get the Lower Triangular Cholesky Decomposition of the following matrix in R using the chol() function. However, it keeps returning the Upper Triangular Decomposition and I can't seem to find a way to get the Lower Triangular…
tattybojangler
  • 1,003
  • 3
  • 15
  • 25
4
votes
0 answers

NMF Sparse Matrix Analysis (using SKlearn)

Just looking for some brief advice to put me back on the right track. I have been working on a solution to a problem where I have a very sparse input matrix (~25% of information filled, rest is 0's) stored in a sparse.coo_matrix: sparse_matrix =…
4
votes
0 answers

How to exactly compute rank of binary matrix in Eigen?

I have a matrix of 0's and 1's, and wish to compute its rank. One approach is to compute an approximate decomposition and return a count of the number of pivots that exceed some small threshold. Though this will usually equal the rank for a…
dshin
  • 2,354
  • 19
  • 29
4
votes
2 answers

Best way to compute a truncated singular value decomposition in java

I want to benchmark the best 2 or 3 libraries to compute a truncated singular value decomposition (SVD), i.e. an SVD where only the k largest singular values are kept. Moreover, I have those constraints : It has to be a java library My matrices are…
Maveric78f
  • 55
  • 6
3
votes
2 answers

cholesky decomposition floating point error

Implementing the Choleky decomposition in Python without the use of numpy.linalg.* (yes this is an assignment) I encountered a Problem regarding the use of floating point numbers. My Algorithm works fine with regualar integers: for i in…
rn42v
  • 97
  • 6
3
votes
0 answers

Calculating Eigenvalue and Eigenvector for 3x3 matrix with Accord.NET

I wanted to get the eigenvectors and eigenvalues out of a 3x3 matrix. I've already tried to use the EigenvalueDecomposition from Accord. The problem(?) I have with the resulting eigenvectors is that online calculators for eigenvectors are giving me…
1
2 3 4 5 6 7