Solve Least Squares Problem for Matrix A and B | Homework Equations

In summary, the given question involves finding the value of x that minimizes the equation ||Ax-b||2. The attempt at a solution involves using the formula (A^TA)-1A^b=x, but since A does not have linearly independent columns, A^TA is not invertible. Alternative methods involve using row reduction to solve for x, which results in a line of solutions.
  • #1
chuy52506
77
0

Homework Statement


Let
A=
|2 -1 -1|
|-1 2 -1|
|-1 -1 2|
and
B=
|1|
|2|
|3|


Homework Equations



Find the x in which minimizes ||Ax-b||2


The Attempt at a Solution


I tried to solve it by using this formula (A**A)-1A**b=x but i get the inverse of A*A equal 0
 
Physics news on Phys.org
  • #2
Greetings! Right, since A does not have linearly independent columns, [tex]A^TA[/tex] is not invertible. Call [tex]B = A^TA[/tex] and [tex]\vec{y} = A^T\vec{b}[/tex] and try using row reduction to solve the matrix equation [tex]B\vec{x} = \vec{y}[/tex] for [tex]\vec{x}[/tex].
 
  • #3
When i try to solve it i get the last row in rref of B=A*A to be a row of 0's equal to 3=/
Is there any other way to solve this??
 
  • #4
I got that

[tex] B = A^TA = \[ \left[ \begin{array}{ccc}
6 & -3 & -3 \\
-3 & 6 & -3 \\
-3 & -3 & 6 \end{array} \right]\][/tex]

and

[tex] \vec{y} = A^T\vec{b} = \[ \left[ \begin{array}{c}-3 \\
0 \\3 \end{array} \right]\][/tex].

Is this what you got? Then we can row reduce

[tex] [ B\ \vec{y} ] = \[ \left[ \begin{array}{cccc}
6 & -3 & -3 & -3 \\
-3 & 6 & -3 & 0 \\
-3 & -3 & 6 & 3 \end{array} \right]\][/tex]

In fact, reducing this shows that there is a free variable, meaning that there is a whole line worth of solutions that give the best approximation.
 
  • #5
thanks!
 

Related to Solve Least Squares Problem for Matrix A and B | Homework Equations

1. What is the purpose of solving a least squares problem for a matrix A and B?

The purpose of solving a least squares problem for a matrix A and B is to find the best fit line or curve that minimizes the sum of the squared differences between the observed data points and the predicted values. This is useful in various fields such as statistics, engineering, and data analysis.

2. What are the basic steps involved in solving a least squares problem for a matrix A and B?

The basic steps involve setting up the problem by defining the matrix A and vector B, calculating the transpose of A, finding the product of A transpose and A, finding the inverse of the product, and finally multiplying the inverse with A transpose and B to obtain the solution.

3. What are some applications of solving a least squares problem for a matrix A and B?

Some applications include linear regression, curve fitting, signal processing, and optimization problems. It is also used in machine learning algorithms for predictive modeling.

4. How is the solution to a least squares problem for a matrix A and B interpreted?

The solution to the least squares problem for a matrix A and B is interpreted as the coefficients of the best fit line or curve. These coefficients can be used to make predictions or analyze the relationship between the variables in the data.

5. Can the least squares method be applied to any type of data?

No, the least squares method is typically used for linear relationships between variables. It may not be suitable for nonlinear relationships or data with outliers. In these cases, alternative methods such as weighted least squares or nonlinear least squares may be more appropriate.

Back
Top