Linear least squares, condition number

In summary, the conversation discusses the solution to the Linear Least Squares problem using a QR factorization and the condition numbers of the matrix A and A|y. The Octave program gives the exact solution despite the large condition numbers, possibly due to the precision of the input and algorithms used.
  • #1
azay
19
0
Hi,

I am trying to learn some numerical algebra. Now I don't understand the following.

I'm finding the solution to the Linear Least Squares problem [tex]min||A\lambda-y||_{2}[/tex], which turns out to be (1,1). I did this by doing a QR factorization using Givens rotations.

with:

[itex]
A=
\[ \left( \begin{array}{ccc}
1 & 1\\
1 & 1.0001\\
1 & 1.0001\end{array} \right)\][/itex]
and
[itex]
y=
\[ \left( \begin{array}{ccc}
2\\
0.0001\\
4.0001\end{array} \right)\]
[/itex]

Now, I have a Octave (matlab clone) program that does the same calculation. As the condition number of the matrix A is very large (4.2429e+004) (found by applying Octave's cond() function on A), I expect the solution to be at least not exact. Yet the Octave program gives the exact solution (1,1), at least, as far as I can see (6 digit accuracy I think), that is. Can someone explain this?

Also, should one consider the condition number of the matrix A when considering the condition of the Linear Least Squares problem, or the condition number of the Matrix A|y?
(The condition number of the latter is even bigger so my first question holds in any case).

Thank you :)
 
Physics news on Phys.org
  • #2
The condition numbers don't tell you that something is definitely not accurate. They tell you what at least can be expected. There are a couple of possible reasons: the input is sufficiently precise for the data memory and algorithmic steps used, the algorithms are identical, or just by chance.
 
  • #3
Matlab computes with internal numerical precision of approximately 1 part in 10^15 or 10^16, I forget which (unless you set it for greater precision). It therefore easily inverts a matrix of condition number 10^4. (In fact, it should work with condition numbers nearing 10^15.) Presumably Octave is similar.
 
  • Like
Likes FactChecker

What is linear least squares?

Linear least squares is a statistical method used to find the best fit line or curve for a set of data points. It is used to minimize the sum of squared errors between the actual data points and the predicted values from the line or curve.

What is the condition number in linear least squares?

The condition number in linear least squares is a measure of the stability of the solution. It indicates how sensitive the solution is to changes in the data. A higher condition number means the solution is more sensitive and less reliable.

Why is the condition number important in linear least squares?

The condition number is important because it helps determine the accuracy and reliability of the solution. A large condition number can lead to significant errors in the solution and can indicate that the problem is ill-conditioned.

How is the condition number calculated in linear least squares?

The condition number is calculated by taking the ratio of the largest and smallest singular values of the data matrix. It can also be calculated by taking the ratio of the largest and smallest eigenvalues of the covariance matrix of the data.

How can the condition number be improved in linear least squares?

The condition number can be improved by reducing the correlation between the independent variables in the data. This can be done by removing highly correlated variables or by using a method such as principal component analysis to reduce the dimensionality of the data.

Similar threads

  • Linear and Abstract Algebra
Replies
5
Views
1K
  • Linear and Abstract Algebra
Replies
2
Views
990
  • Linear and Abstract Algebra
Replies
3
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
2K
  • Linear and Abstract Algebra
Replies
3
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
2K
  • Linear and Abstract Algebra
Replies
7
Views
914
  • Linear and Abstract Algebra
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
1
Views
847
  • Linear and Abstract Algebra
Replies
14
Views
1K
Back
Top