Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Equation/mathematical model to a fitted line

  1. Apr 13, 2013 #1
    Hi I hope someone can either help me directly and give me an overview of what needs to be done and also direct me to a textbook or some source which will allow me to learn this in depth.

    Basically If I have data and I graph it, I fit a line to it (it can be curved) how then do I determine an equation to represent that line and allow me to extrapolate.

    For example if the line is sinusoidal or straight and then beginning to curve etc how can I make a mathematical model to represent these different types of curves.

    Thanks very much,

  2. jcsd
  3. Apr 13, 2013 #2


    User Avatar
    Education Advisor
    Gold Member

    Sounds like precalculus, or maybe even algebra two. You can take points from the line and decipher its equation using various formulas.. Hmm try rea's problem solvers "algebra and trig" it's a pretty good book. Or any precalculus/college algebra book.. We used Larson but I never liked the textbook layout much.
    Last edited: Apr 13, 2013
  4. Apr 13, 2013 #3
    But would that be able to make a model for data which starts of linear and then turns exponential? if so great!
  5. Apr 13, 2013 #4


    User Avatar
    Education Advisor
    Gold Member

    I think you'd do a best fit line for the data.
  6. Apr 13, 2013 #5
  7. Apr 13, 2013 #6
    If you have the data, and you know the general form of the curve you want to fit, then you can use non-linear regression to find the exact form of the function which best fits your data.

    I just had a quick look at the wikipedia page and it's fairly awful, and my knowledge of stats books isn't great / I don't know what level you're used to reading. Do you have a particular computer software package that you have the data in? eg. if it's in MATLAB, their documentation gives a very concise explanation of it.

    In short... non-linear regression is the word you want to be searching for.

    You give a guess function f(x,[parameters]) and the data [(x1,y1), ... (xn,yn)] and it will find the parameters that minimises the sum of the residuals squared, [y1 - f(x1)]^2 + ... + [yn - f(xn)]^2. Sometimes it takes a while and if the function is tricky then it might not work.
  8. Apr 13, 2013 #7


    User Avatar
    Education Advisor
    Gold Member

    Yeah, whichever line fits the data best with the smallest SSE.

    Ahah yeah definitely not algebra 2. Finite mathematics, discrete math or a calc book might help you. I cannot!

    The bottom example is two different lines but I get the joist of what you're saying. Maybe post the question in the statistic fourm?
    Last edited: Apr 13, 2013
  9. Apr 13, 2013 #8
    I was going to use 'R' to put the data in (exporting from excel). Ok thats helpful so non linear regression! I was just worried that it wasn't going to be a simple curve and so I knew I'd need some other way to make a formula. I still havnt finished collecting my data so I have plently of time to read up on it. I kind of want to know how to do it by hand so il peruse amazon.

    I did engineering in college and so I am no mathematician!

  10. Apr 13, 2013 #9
    R should be fine. If you buy a book, check it's got a chapter on nonlinear regression, but what you mainly need to do is pick the right guess function. The maths of fitting it to the data is pretty hard work, and best left to a computer!
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook