Turn on thread page Beta
    • Thread Starter
    Offline

    0
    ReputationRep:
    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

    Thanks in advance (needed asap)
    Offline

    0
    ReputationRep:
    (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

    Thanks in advance (needed asap)
    is this degree level maths?
    Offline

    8
    ReputationRep:
    (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

    Thanks in advance (needed asap)
    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.

    Edit2: made the vectors bold.
    Offline

    15
    ReputationRep:
    (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.
    Offline

    15
    ReputationRep:
    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?
    Offline

    15
    ReputationRep:
    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.
    • Thread Starter
    Offline

    0
    ReputationRep:
    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.
    Offline

    15
    ReputationRep:
    (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

    Thanks in advance (needed asap)
    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
 
 
 

University open days

  • University of Bradford
    All faculties Undergraduate
    Wed, 21 Nov '18
  • Buckinghamshire New University
    All Faculties Postgraduate
    Wed, 21 Nov '18
  • Heriot-Watt University
    All Schools Postgraduate
    Wed, 21 Nov '18
Poll
Black Friday: Yay or Nay?
Useful resources

Make your revision easier

Maths

Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

Equations

How to use LaTex

Writing equations the easy way

Equations

Best calculators for A level Maths

Tips on which model to get

Student revising

Study habits of A* students

Top tips from students who have already aced their exams

Study Planner

Create your own Study Planner

Never miss a deadline again

Polling station sign

Thinking about a maths degree?

Chat with other maths applicants

Can you help? Study help unanswered threads

Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.