Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [linear-algebra]

Questions on the algorithmic/computational aspects of linear algebra, including the solution of linear systems, least squares problems, eigenproblems, and other such matters.

1
vote
1answer
114 views

More efficient matrix multiplication with diagonal matrix

A sparse matrix $\mathbf{L}$ is formed by $\mathbf{L} = \mathbf{DKG}$. $\mathbf{D}$ is a sparse matrix of size $m \times n$. $\mathbf{G}$ is a sparse matrix of size $n \times m$. $\mathbf{K}$ is a ...
2
votes
1answer
52 views

Implicit solution to Sylvester equation

Suppose a matrix $M\in\mathbb{R}^{n\times n}$ is defined as the solution to a Sylvester equation $$AM+MB=C,$$ for some fixed (known) matrices $A,B,C$. In the regime where $n$ is large, we may with ...
0
votes
1answer
104 views

Linear Least-Squares Point-to-Plane ICP degenerative case

I'm trying to implement Linear Least-Squares Optimization for Point-to-Plane ICP Surface Registration Paper describes linear approximation for point to plane distance for rigid ICP. This approach is ...
1
vote
1answer
67 views

Solving for $C$ in $Q = YCZ$ using least squares in Matlab

I am trying to solve for the matrix $C$ in $Q = YCZ$ in matlab. I have preliminary results but they don't seem realistic. Here, $Q$ is $n \times m-1$, $Y$ is $n \times p$, $C$ is $p \times m$ and $Z$ ...
1
vote
0answers
83 views

Low memory algorithm for matrix diagonalisation

I'm trying to find the largest eigenvalues of very large $N \times N$ matrices ($N = 10^{10}$ and larger). The matrices are not sparse but the multiplication operation is fast. For now, I'm using ...
9
votes
0answers
136 views

Inverse problem in linear ODE

I have a linear ordinary differential equation (ODE) with a system matrix with constant coefficients: $$\dot{y}(t) = \mathcal{A}\; y(t), \quad y(0) = y_0$$ with $y(t) \in \mathbb{R}^{n \times 1}$ and $...
1
vote
0answers
35 views

Name for vectors in a Krylov space but not the preceding one

It seems to me that a useful concept to define when studying Krylov subspace methods is the idea of a vector that belongs to a Krylov subspace $\mathcal{K}_{n+1}(A,b)$ but not to the preceding one $\...
1
vote
0answers
51 views

Algorithm design to filter on 5,000 stocks each of which has 4 months worth of data points

I want to filter on 5000 stocks, each of which has 4 month or more worth of data (>= 500 data points each). my filtering criteria will be based on 8 calculated values from the data points. for example,...
7
votes
0answers
182 views

Eigenvalue with largest imaginary part

Iterative eigensolvers such as ARPACK, give the option to find a subset of the eigenvalues which have the largest imaginary part. My question is how do these algorithms work. As I understand it, ...
5
votes
1answer
125 views

Eigenvector with maximum overlap

Given a matrix $M$ and a vector $v$, is there an efficient method to find the normalized eigenvector of $M$ that is closest to $v$, in that it has maximal overlap. More explicitly, a vector $v$ can be ...
1
vote
1answer
165 views

Method to solve linear, first order ODE of generalized matrix matrix form

The equation and its meaning: Consider two sets $(A)_{l=0,...,m_a},$,$(B)_{l=0,...,m_b}$ of hermitian matrices and a set of positive semidefinite matrices $(C)_{l=0,...,m_c}$. Each matrix has the ...
1
vote
0answers
70 views

Successive iteration method for solving eigenvalue ploblem

I have a question concerning the branch of successive iteration methods (Newton, Runge-Kutta). I definitely know (or can read in Wikipedia) the implementation of these methods. But I was wondering ...
1
vote
0answers
95 views

Linear regression with inequality constraint in Java

I haven't been doing math in years and I'm facing the following problem. I'm trying to implement in Java a linear regression under a set of inequality constraints. Sorry in advance for all the ...
6
votes
0answers
147 views

Multi-matrix orthogonal basis problem

Suppose we are given a set of symmetric, positive definite matrices $A_1,A_2,\ldots,A_k\in\mathbb{R}^{n\times n}$. Is there any numerical method or reduction to a known problem (e.g. eigenvalue ...
1
vote
1answer
180 views

Methods for solving $Ax=b$, small and sparse A

I'm trying to solve/implement a system of linear equations of the following form/structure: $$ Ax=b$$ $$A = \begin{bmatrix} * & * & 0 & * & -1 & 0 & 0 & 0 \cr * & * &...
1
vote
0answers
47 views

Selecting n points to have a given mean and covariance

I have a set $N$ points in $d$-dimensional space, $\mathbf{x}_i \in \mathbb{R}^d ~~ \forall i=\{1,2,...,N\}$. How to choose $n$ points from the set such that it maximises $$ f = |\mathbf{S}|^{-n/2} \...
1
vote
1answer
108 views

Matrix exponential by eigenvectors - implementation issues

I posted a similar question yesterday but I deleted it since I think that I had to reformulate it after some insights. I want to calculate $$ \exp(-i\Delta t\,\mathcal{H}) = V\,\mathrm{diag}(\{\exp(-...
1
vote
0answers
32 views

Deterministic method to compute “Process noise covariance matrix, Q” for a Kalman filter when parameter variations of the model is known apriori

I am implementing a Kalman filter (for a linear ODE system for now). My model represents a physical device that has 6 "parameters", i.e. those values of the device do not evolve over time (within a ...
9
votes
2answers
200 views

Eigenvalues of Small Matrices

I'm writing a small numerical library for 2x2, 3x3, and 4x4 matrices (real, unsymmetric). A lot of numerical analysis texts highly recommend against computing the roots of the characteristic ...
0
votes
2answers
122 views

Computing Eigenvectors in MATLAB

I am assigned to compute eigenvalues and eigenvectors in MATLAB of a 2x2 matrix: $$ A = \left( \begin{matrix} 3 &0\\ 4 &5\\ \end{matrix} \right) $$ I know that the textbook's solution states ...
6
votes
4answers
1k views

Generate a set of orthogonal vectors to a given vector

I am looking for an alternative and robust alternative to Gram-Schmidt orthogonalization, but with one constraint: I have a unit vector $\mathbf{v}_1 \in \mathbb{R}^d \,\text{s.t.} \,\|\mathbf{v}_1^T\...
1
vote
0answers
129 views

Numerical Precision in Matrix Inversion Routines

Let's say I have a matrix $\mathbf{A}\in\mathbb{R}^{n\times n}$, and its associated inverse, $\mathbf{A}^{-1}$. The elements of $\mathbf{A}$ are given in IEEE single precision, i.e. 23-bit mantissa, ...
2
votes
5answers
413 views

c++ Libraries for large linear system of equations

I am looking for libraries for solving large scale linear system (10e5) of equations using parallelization and shared memory. 1. Sparse, complex symmetric, SPD. 2. Suitable for higher order FEM ,...
4
votes
1answer
300 views

Poor SVD reconstruction of singular matrix

I am trying to calculate the singular value decomposition of this matrix using numpy.linalg.svd . However, reconstructing the matrix from the SVD gives a poor ...
1
vote
0answers
136 views

How to make LAPACK eigenvectors orthogonal like Matlab?

I'm using LAPACK zgeev to calculate eigenvectors of a symmetric complex matrix of high dimensions ($n \approx 2000$). I need these eigenvectors to satisfy $$\sum_{...
3
votes
1answer
829 views

Computing the Cholesky decomposition based of the QR decomposition

Let A be a n×n positive-definite Hermitian matrix. I already have the QR decomposition of A. Is there an efficient way to utilize this knowledge to speed up the Cholesky decomposition of A?
1
vote
2answers
103 views

Numerically stable computation of $F((ax+b)^k)$

Let $F: \mathbb{R} \rightarrow \mathbb{R}$ be a linear map. I want to evaluate an expression of the type $$F((ax+b)^k)$$ in terms of $F(x)$ for some fixed value of $x$ (I already know $F(x)^r$ for $r=...
4
votes
2answers
229 views

Difference in performance of preconditioned GMRES and MINRES

I have two matrices $A, B$ coming from a finite element discretization of a system of partial differential equations. $A$ represents the system matrix and is symmetric and indefinite. $B$ is symmetric ...
13
votes
4answers
224 views

Rapidly determining whether or not a dense matrix is of low rank

In a software project that I'm working on, certain computations are vastly easier for dense low-rank matrices. Some problem instances involve dense low-rank matrices, but they're given to me in full, ...
0
votes
1answer
50 views

Maximize sum(AI) for matrix A and any permutation of identity matrix I

I have a random binary matrix $A$ $$ A=\left[\begin{array}{c c c c c}0&0&0&0&1\\0&1&0&1&0\\1&1&1&1&0\\0&1&1&0&0\\1&0&1&1&...
1
vote
1answer
150 views

How can I solve on a computer a large projection problem with redundant constraints?

This question is the essence of this one. After we remove all the cruft, we can recast it as follows: Problem: Given $b \in \mathbb{R}^n$, $C\in \mathbb{R}^{n\times m}$, and $g\in \mathrm{Range}(C^...
2
votes
0answers
53 views

How can I numerically solve a saddle point problem with repeated constraints?

I am interested in numerically solving the following constrained minimization problem; Find the value of $x\in \mathbb{R}^n$ that minimizes $f$ where $f\colon \mathbb{R}^n\to \mathbb{R}$ is defined ...
0
votes
1answer
260 views

Fast way to compute the diagonal elements of the inverse of covariance matrix

We have a variance-covariance matrix denoted with $X^TX$, where $X$ is the design matrix. In linear regression we can estimate beta coefficients with normal equations like $\hat{\beta} = (X^TX)^{-1}X^...
1
vote
0answers
154 views

Best algorithm for inversion of matrix spanning many orders of magnitude [duplicate]

I have a very similar problem to the one described in Calculate inverse of dense matrix with entries of very different magnitude. The reason why I am opening a new question is because as far as I ...
1
vote
1answer
63 views

What is the difference in the pivoting strategies between LAPACK's dpstrf and dpst2 and why?

dpstf and dpstrf sometimes give different pivot results. Of course I can read the source code, but I don't get the idea from it. Since pivoting is for stability of the Cholesky decomposition, one of ...
1
vote
1answer
416 views

Regularization vs constrained optimization of an ill posed tomography problem

I am trying to solve an ill-posed linear system of equations. The particular system has 160 equations and 400 variables. Moreover, the condition number of the left hand side matrix is of order $10^{16}...
0
votes
1answer
70 views

Invert a matrix only on a subset of variables / Compute the “equivalent circuit”

Suppose I have a complicatedly shaped conductor with inhomogeneous conductivity. The conductor is modeled using the Finite Element Method. The conductor has electrical contacts on both ends. Those ...
4
votes
0answers
98 views

How to stochastically estimate the trace of a matrix?

Specifically, the diagonal elements (can possibly both positive and negative) of the matrix can be computed efficiently but the total number is large ($\mathcal O(10^{18})$). My first thought about ...
4
votes
2answers
367 views

Quadratic programs with rank deficient positive semidefinite matrices

Let $A$ be a $n\times n$ square symmetric matrix. In addition, $A\succeq0$ and $\mathrm{rank}(A)<n$. This means that all eigenvalues are non-negative, but also that there are some zero eigenvalues. ...
0
votes
1answer
362 views

Set of linear ordinary differential equations with a mass matrix

What methods are known for efficiently solving a large set of linear homogeneous ordinary differential equations of the following form? \begin{equation} \mathbf{B} \frac{d\mathbf{y}}{dt} = \mathbf{A} \...
1
vote
1answer
134 views

Matrix Decomposition of Conics

I was reading about ellipse-ellipse intersection and I came across this article: https://math.stackexchange.com/questions/679622/intersection-between-conic-and-line-in-homogeneous-space/867428#...
1
vote
0answers
42 views

Any method to efficiently compute SVD of a perturbation of matrix $\bf A$ if the SVD of $\bf A$ is already known? [duplicate]

Suppose we know the SVD of matrix $\bf A$, and $\bf B$ is a slight perturbation of $A$ (e.g. $\|{\bf B}-{\bf A}\|_{\text F}$ is relatively small), then is there any method that can efficiently compute ...
0
votes
1answer
93 views

simple matrix multiplication?

can any one show the steps how I convert the summation to norm as below: $$ \sum_{j=1}^{M'} \big(\lambda_j (\mathbf{L}\mathbf{x})^2_j\big) = \|\mathbf{L}_\lambda \mathbf{x}\|^2, \qquad\text{where } \...
1
vote
0answers
44 views

How is the Gastner-Newman equation implemented to create value-by-area cartograms?

There is a paper called "Density-equalizing map projections: Diffusion-based algorithm and applications" by Michael T. Gastner and M. E. J. Newman, which explains their algorithm (which is based in ...
1
vote
1answer
71 views

Efficient computation of $BX=A$ when LU factorization of $A$ is given

First, $AX=B$ is solved, so I have the LU factorization of $A$ computed already. Now I need to solve $BX=A$. Is there any way to reuse this information (LAPACK ...
0
votes
1answer
768 views

How Jacobian matrix helps optimization faster?

I tried some python optimization functions and some of them needed Jacobian matrix prior for faster convergence. I understand Jacobians are basically transformation matrices that data from one space ...
2
votes
2answers
118 views

Efficient computation of AX=B where B has special structure (block-diagonal)

In case B(size ~ 2k, complex double) is block-diagonal, where block size is small(e.g. 2), is there any more efficient way to compute this other than Lapack gesv?
10
votes
2answers
360 views

Eigenvectors of a small norm adjustment

I have a dataset that is slowly changing, and I need to keep track of eigenvectors/eigenvalues of its covariance matrix. I've been using scipy.linalg.eigh, but it'...
1
vote
1answer
192 views

Why the product of symmetric-sparse matrices is not symmetric, or dense

For the equation $\frac{\partial u}{\partial t}=-(-\Delta)u$ with zero boundary condition using finite element method. Applying the corresponding weak formulation and taking $v=\phi_{j},j=1,2,...,N$, ...
1
vote
1answer
152 views

Fast counting of all submatrices of a binary matrix with a full column rank

I have a binary full-rank matrix of size, say, $25 \times 50$. I need to count how many subsets of its columns form matrices with a full column rank, i.e. all the columns in the subset are linearly ...