1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Least squares approximation of a function?

  1. Mar 29, 2016 #1
    1. The problem statement, all variables and given/known data
    Find the least squares approximation of cos^3(x) by a combination of sin(x) and cos(x) over the interval (0, 2pi)

    2. Relevant equations

    3. The attempt at a solution
    I know how to find a least squares approximation with vectors, but I don't even know how to start with a function? The normal equation wouldn't work here because there are no vectors correct? The answer in the back of the book gives sin (x)+(3/4)cos(x), but I don't even know what that answer means. Please help.
  2. jcsd
  3. Mar 29, 2016 #2

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper

    You won't be able to do it by folowing a formula... you need to understand what least squares regression is and apply the principle. The formula for vectors should have been derived for you. Note: cos and sin are vectors.

    So if you had an arbitrary vector, ##\vec a## and you needed it in terms of two other vectors ##\vec u## and ##\vec v##... how would you go about it?
    Last edited: Mar 29, 2016
  4. Mar 30, 2016 #3


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Perhaps you don't know what the answer means because you don't know the definition of least squares approximations for functions. Surely it is in your text. Or looking here:


    might help you get started. Also, I think your text answer isn't correct.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted