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!

Least Squares Fit

  1. Dec 3, 2009 #1
    1. The problem statement, all variables and given/known data
    For the following data, find the least squares fit of the given form
    x=1,2,3,4,6
    y=14,10,8,6,5
    h(x)=ae^x+be^(-x)

    2. Relevant equations



    3. The attempt at a solution
    So I tried to linearize the equation by taking the natural log of everything
    ln(h)=ln(ae^-x)+ln(be^ex)
    ln(h)=ln(a)+ln(b)+x-x

    that when I run into a problem, I eliminate the x's.
    My question is, is there another way to linearize the equation or should I continue though?
     
  2. jcsd
  3. Dec 4, 2009 #2
    That's not right. In particular,
    [tex] \ln (ae^{-x} + be^x) \neq \ln (ae^{-x}) + \ln (be^x) [/tex]
     
  4. Dec 4, 2009 #3

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    There is no reason to linearize anything. Nor are you trying to fit the curve to those points- just the "least squares" fit.

    If [itex]h(x)= ae^{x}+ be^{-x}[/itex] then [itex]h(1)= ae+ be^{-1}[/itex]. Since you are told that y= 14 when x= 1, the "error" is [itex]ae+ be^{-1}- 14[/itex] and the "error squared" is [itex](ae+ be^{-1})^2[/itex]. Similarly, for x= 2, y= 10, the "error squared" is [itex](ae^2+ be^{-2}- 10)^2[/itex].

    For all 5 x,y pairs, the sum of errors squared is [itex](ae+ be^{-1}- 14)^2[/itex][itex]+ (ae^2+ be^{-2}- 10)^2[/itex][itex]+ (ae^3+ be^{-3}- 8)^2[/itex][itex]+ (ae^4+ be^{-4}- 6)^2+ (ae^6+ be^{-6}-5)^2[/itex]. Find a and b to minimize that.
     
  5. Dec 4, 2009 #4
    What procedure would I use to find a and b? I know about the error...would I convert the sum of the errors squared into normal equations?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Least Squares Fit
  1. Least Squares Fitting (Replies: 1)

  2. Least squares fitting (Replies: 12)

  3. Least-squares fit (Replies: 2)

Loading...