Matrix reduction for large data set to solve linear equations

29 Views Asked by At

I've got a large set of linear equations at work to try to solve. These could be 200-300 rows of linear equations and 100-150 variables. Some of these variables won't be solvable, ie the linear equations that I have isn't enough to provide a solution.

Is there any existing software that I could use to help reduce the linear equations into a set of solvable equations? I'm thinking some form of matrix reduction but my engineering maths from 20 years ago isn't good enough to think of a solution.

I've just installed GNU Octave, so would be great too if someone could point me to the right direction on the above problem using GNU Octave.

Thanks.

1

There are 1 best solutions below

2
On

You can use the Julia language interface as a matrix calculator

A = rand(300,100)
b = rand(300)
x = A\b

and you get a solution that is equivalent to

x = inv(A'*A)*A'*b

where A' is the transpose of A, and the inv() function inverts a matrix

Mathematically the above solution to $Ax=b$ corresponds to the Penrose pseudo-inverse, also known as the least squares fit.

$$ x = \left(A^\intercal A \right)^{-1} A^\intercal b $$

Looking at the GNU Octave website, it has a very similar syntax for solving a linear system of equations. I don't know if it will do the least squares thing automatically like Julia does.

fig1