You are Here: Home >< Maths

# least squares using vandermonde matrix watch

1. How do you find a 3rd order polynomial for a least square routine using a vandermode matrix? Can this be worked out with an example for instance 8 data points?

|x | 1.01, 2.2, 2.9,4.03,5.32,6.22,8.56,9.09
|y | 18.5,76.2,150.5,365,780,1265,325 0,7099

2. (Original post by himurakenshin)
How do you find a 3rd order polynomial for a least square routine using a vandermode matrix? Can this be worked out with an example for instance 8 data points?

|x | 1.01, 2.2, 2.9,4.03,5.32,6.22,8.56,9.09
|y | 18.5,76.2,150.5,365,780,1265,325 0,7099

is this degree level maths?
3. (Original post by himurakenshin)
How do you find a 3rd order polynomial for a least square routine using a vandermode matrix? Can this be worked out with an example for instance 8 data points?

|x | 1.01, 2.2, 2.9,4.03,5.32,6.22,8.56,9.09
|y | 18.5,76.2,150.5,365,780,1265,325 0,7099

You can use a vandermonde matrix to do this. See here for details.

In esssence, you have Vx = b.
Where V is the Vandermonde matrix of x^n-values, x is a column vector of a-values, b is vector of y-values.
Get the inverse of V and solve for x - the coefficients of x^n.

You're going to have an 8x4 matrix to work with though. You may wish to use mat-lab or sci-lab , or something like that.

Edit:I said get the transpose of V - sorry - that should have been the inverse of V.

4. (Original post by Fermat)
You can use a vandermonde matrix to do this. See here for details.

In esssence, you have Vx = b.
Where V is the Vandermonde matrix of x^n-values, x is a column vector of a-values, b is vector of y-values.
Get the transpose of V and solve for x - the coefficients of x^n.

You're going to have an 8x4 matrix to work with though. You may wish to use mat-lab or sci-lab , or something like that.
That looks like a way to get a polynomial going through the points - and you'd generally need a degree 7 poly for 8 given points. The link doesn't mention least squares.

Not that I know how to do the given problem - I'm confused by the fact that the VDM is a square matrix always and so I'm not sure how it could be employed with an 8x4 array.
5. Actually thinking about it a bit more, if M is the 8x4 Van Der Monde and b contains the y-values and a is the column vector of coefficients of the cubic then you are looking to minimise

|Ma-b|2 = (Ma - b)T(Ma-b)

How much multivariable calculus do you know? Do you know how to take the grad of this?
6. So you're looking to minimise

aTMTMa - bTMa - aTMTb + bTb

If you grad this you get

2 (aTMTM - bTM)

So you will have a minimum when

aT = bTM(MTM)-1

provided that MTM is an invertible 4x4 matrix.
7. I'm still not very clear on this, but I will give it a shot. Would you mind please solving the example I posted earlier? I'm pretty sure a worked example will clear everything up.
Thanks.
8. (Original post by himurakenshin)
How do you find a 3rd order polynomial for a least square routine using a vandermode matrix? Can this be worked out with an example for instance 8 data points?

|x | 1.01, 2.2, 2.9,4.03,5.32,6.22,8.56,9.09
|y | 18.5,76.2,150.5,365,780,1265,325 0,7099

Call the above x-values x1,...,x8

Call the y-values y1,...,y8

Set

bT = (y1,...,y8)

aT = (a0,a1,a2,a3)

<these are the coefficients of the cubic a0 + a1 x + a2 x^2 + a3 x^3>

Then set M to be an 8x4 matrix whose ith row is

1, xi, (xi)^2, (xi)^3

then I gave you in my previous post the value of a that will give you the least squares error

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: July 8, 2005
Today on TSR

### Edexcel C4 Maths Unofficial Markscheme

Find out how you've done here

### 1,011

students online now

Exam discussions

Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams