Building a least square problem design matrix

Click For Summary

Homework Help Overview

The discussion revolves around constructing a least squares problem to fit an arbitrary function f(t) with a polynomial of degree n - 1 using values from a set of points. Participants are exploring how to formulate the matrix A and vector b in the context of this problem.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the use of a Vandermonde matrix as a potential approach to construct the least squares problem. There are attempts to clarify how the matrix A can be derived from the Vandermonde matrix and questions about whether this formulation would be effective.

Discussion Status

Some participants have provided insights into the structure of the matrices involved and have suggested using the Moore-Penrose inverse for solving the system. There is an ongoing exploration of the relationships between the Vandermonde matrix and the least squares formulation, with no explicit consensus reached.

Contextual Notes

There is uncertainty regarding the specific course context of the original poster, which may influence the approach to the problem. Participants are also considering the implications of overdetermined systems in their discussions.

papasmurfff
Messages
3
Reaction score
0

Homework Statement


Suppose we want to to fit an arbitrary function f(t) with a polynomial of
degree n - 1 using the values of the function in an arbitrary set of points z = [z1; z2; : : : ; zm].

how would do i construct the least squares problem Ax=b. in other words, how would i construct the matrix A and b in terms of f(t) and z ?


Homework Equations





The Attempt at a Solution



vandermonde's matrix
 
Physics news on Phys.org
papasmurfff said:

Homework Statement


Suppose we want to to fit an arbitrary function f(t) with a polynomial of
degree n - 1 using the values of the function in an arbitrary set of points z = [z1; z2; : : : ; zm].

how would do i construct the least squares problem Ax=b. in other words, how would i construct the matrix A and b in terms of f(t) and z ?


Homework Equations





The Attempt at a Solution



vandermonde's matrix

Suppose, for example, you want to fit a quadratic y = a + b*z = c*z^2 to data (z1,y1), (z2,y2),..., (zn,yn). You thus want to fit a linear form Y = c0*X0 + c1*X1 + c2*X2 to the data, where x0[j] = 1, x1[j] = zj and x2[j] = zj^2 for j = 1,...,n. So, you want to minimize S = sum_{j=1..n}(yj - c0*x0[j]-c1*x1[j]-c2*x2[j])^2. Differentiate wrt c0, c1 and c2 and equate the derivatives to zero. You will get a system of linear equations for c0, c1 c2. If you actually sit down and do this you will be answering your own question.

RGV
 
thank you RGV. if i put it in the form of vandermonde matrix would that work also?
 
papasmurfff said:
thank you RGV. if i put it in the form of vandermonde matrix would that work also?

The vandermonde matrix is the matrix of columns X0[j] = 1,j=1..,n, X1[j = zj], i=1..n and X2[j] = zj^2, j=1..n. It is not the A-matrix of the least-squares method, although you build A starting from the vandermonde matrix. Like I said: write things out in detail to see what is happening.

RGV
 
Ray,

Just a thought. In your example, suppose we let

[tex]A = \begin{pmatrix} 1 & z_1 & z_1^2 \\ 1 & z_2 & z_2^2 \\ . & . & . \\ 1 & z_n & z_n^2 \end{pmatrix}[/tex]

[tex]x = \begin{pmatrix} c_0 \\ c_1 \\ c_2 \end{pmatrix}[/tex]

[tex]b = \begin{pmatrix} y_1 & y_2 & ... & y_n \end{pmatrix}[/tex]

And get a least squares solution to the overdetermined system of equations [itex]Ax = b[/itex] by using the Moore-Penrose inverse of A. Have we solved an equivalent problem?

I don't know whether papasmurff is taking a course that might cover that.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K