Ronnie Kisor
Ronnie Kisor

Reputation: 121

Solving large system of equations with 4 unknowns

I have a dataset including the distance and bearing to ~1800 fused radar contacts as well as the actual distance and bearing to those contacts, and I need to develop a correction equation to get the perceived values to be as close to the actual values as possible.

There seems to be a trend in the error when visualizing, so it seems to me that there should be a somewhat simple equation to correct it.

This is the form of the ~1800 equations:

actual_distance = perceived_distance + X(percieved_bearing) + Y(speed_over_ground) + Z(course_over_ground) + A(heading)

What is the best way to solve for X, Y, Z, and A?

Also, I'm not convinced that all of these factors are necessary, so I'm completely willing to leave out one or two of the factors.

From the little linear algebra I understand, I've attempted something like this with no luck:

Ax = b --> x = b/A via numpy.linalg.solve(A, b)

where A is the 4 x ~1800 matrix and b is the 1 x ~1800 matrix

Is this on the right track?

To be clear, I'm expecting to generate coefficeints for an equation that will correct percieved distance to a contact so that it is as close as possible to the actual distance to contact.

I am also totally willing to abandon this method if there is abetter one.

Thanks for your help in advance.

Upvotes: 1

Views: 318

Answers (2)

Juan Carlos Ramirez
Juan Carlos Ramirez

Reputation: 2129

When you have more equations than unknowns, you might not have an exact solution. In such a case what you can do is use the Moore-Penrose pseudoinverse of your matrix A. A times b will give you the least-square distance solution. In numpy you can use https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.lstsq.html#numpy.linalg.lstsq

Upvotes: 1

Eamonn Kenny
Eamonn Kenny

Reputation: 2042

The best way to solve such a system of equations is to use the: Incomplete Cholesky Conjugate Gradient Technique (ICCG). This can be implemented in Matlab, Numerical recipes in C++, Nag Fortran or many other languages. Its very efficient. Basically you are inversing a large banded matrix. The book by Golub describes it in detail.

Looks like this is useful:

https://docs.scipy.org/doc/numpy-1.14.1/reference/generated/numpy.linalg.cholesky.html

Upvotes: 1

Related Questions