Linear Algebra - Least Squares

Click For Summary

Homework Help Overview

The discussion revolves around applying least-squares fitting to two proposed equations using a dataset of 100 pairs of values (t, b). The equations involve exponential and polynomial terms with unknown coefficients that need to be determined through fitting.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the structure of the matrix A for both equations and the formulation of the least-squares problem. There are questions about the initial steps to take and the use of QR factorization versus traditional methods for solving the resulting linear system.

Discussion Status

Some participants provide insights into the formulation of the matrices and the linear systems involved, while others express uncertainty about the initial approach and seek clarification on the use of QR factorization in this context. There is no explicit consensus on the best method to proceed, but guidance on the problem setup has been offered.

Contextual Notes

Participants note the challenge of working with a 100x3 matrix and the implications of using QR factorization for solving the least-squares coefficients without forming traditional normal equations.

sheepover
Messages
4
Reaction score
0

Homework Statement

Test these two equations, using least-squares fitting of the data (ti, bi), i = 1, 2, . . . , 100:1.
[tex]b(t) = d_{1} + d_{2}te^{-t} + d_{3}t^{2}e^{-2t}[/tex]2.
[tex]b(t) = d_{1} + d_{2}\sqrt{t}e^{-\sqrt{t}} + d_{3}te^{-2\sqrt{t}}[/tex]

where d1, d2, d3 in R are unknown.

For both theories, compute the resulting values of the constants d1, d2, d3 and produce a graph that shows the original data and the computed function b(t).

Which one of the two theories is more appropriate for the given data?We are given t and b as 1x100 matrices in matlab, and I also have a Modified Gram-Schmidt program in MATLAB that computes Q and R for any matrix A, which is supposed to be used to solve this problem.

Homework Equations



A = QR
ATAx = ATb
min||b-Ax||

The Attempt at a Solution



Not even sure where to start. I've been searching online for any guidance for hours. Textbook is no help either.

If someone could at least point me in the right direction, or give me some steps to solve this, it would be appreciated.
 
Physics news on Phys.org
For 1, A is the matrix having each row of the form
[tex]\begin{array}{ccc}1 & t_ie^{-t_i} & t_i^2e^{-t_i}\end{array}[/tex]
for each i. It will have 3 columns and 100 rows.

Similarly, for 2 A is the matrix having each row of the form
[tex]\begin{array}{ccc} 1 & \sqrt(t)e^{-\sqrt(t)} & te^{-2\sqrt{t}}\end{array}[/tex]

Again it has 3 columns and 100 rows.
 
I am not sure where your confusion lies. Do you understand that what you need to do is to solve the 3 x 3 linear system B p = r, where B = A^T * A, r = A^T * b and p = column vector (d1,d2,d3)? If you don't get this, you really do need to go back and review the basics.

OK, so if you understand that you need to solve a 3 x 3 linear system, there is the issue of how to do that. You could simply write down the equations in Matlab and ask it to solve them---no matter how it chooses to do it. On the other hand, maybe the question is more about how to use QR factorization in solving the resulting 3 x 3 system---I don't know: I can't tell, from what you have written. (I do know that I, personally, would *never* ask anybody to use a factorization of a 100 by 3 matrix to solve a 3 by 3 system; I might ask for a QR factorization of the 3 by 3 matrix, but that is a different story.)

RGV
 
The point of the exercise given to sheepover is to use QR factorization on the data set and the trial functions in the problem to find the least-squares coefficients without forming the normal equations traditionally used for such calculations. In this case, it means the QR method is used directly on an over-determined system with 100x3 terms as one component.

Sheepover's Google must be broken because searching with "least squares QR" found results immediately.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K