+ Reply to Thread
Results 1 to 11 of 11

Best Fit Curve

Hybrid View

  1. #1
    Registered User
    Join Date
    03-01-2010
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    4

    Best Fit Curve

    hi,
    i want 2 plot a best fit curve. i have 3 different series of data plotted on a chart and want to put in an average curve. my x and y data are different for all 3 sets of data!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Best Fit Curve

    Hi niall, welcome to the forum. Could you post a sample file?

    You can upload a file by clicking "Go Advanced" below the Quick Reply box and then the paper clip icon.

  3. #3
    Registered User
    Join Date
    03-01-2010
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Best Fit Curve

    thanks. i hav a attached the file. i want to insert a best fit curve to the chart with 3 curves in it already!
    Attached Files Attached Files

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Best Fit Curve

    I would say, just looking at it, that your green curve is medium already.
    Not only by the fact that 100mm is middle of 50 and 150, but also it has most data (wich bring it to most reliable function) and it's smooth...

    So, instead of looking all 3 of them, why don't you just deal with 100mm curve?
    Never use Merged Cells in Excel

  5. #5
    Registered User
    Join Date
    03-01-2010
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Best Fit Curve

    i'm not to sure how 2 explain it! i basically need to integrate the 3 graph's into 1 but i can't just take the 100mm curve as it is not really the medium!

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Best Fit Curve

    I'm going to provide you with a solution and it look worst than it is !!

    See attachement.

    all is based on linear interpolation. I need the INDEX / MATCH to find points before and after the new X value.

    =INDEX($B$3:$B$34,MATCH($M4,$A$3:$A$34,1),1)+($M4-INDEX($A$3:$A$34,MATCH($M4,$A$3:$A$34,1),1))*(INDEX($B$3:$B$34,1+MATCH($M4,$A$3:$A$34,1),1)-INDEX($B$3:$B$34,MATCH($M4,$A$3:$A$34,1),1))/(INDEX($A$3:$A$34,1+MATCH($M4,$A$3:$A$34,1),1)-INDEX($A$3:$A$34,MATCH($M4,$A$3:$A$34,1),1))
    It can all be shortened, but I'have to go to bed It's 00:53
    Attached Files Attached Files
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Best Fit Curve

    rwgrietveld, if you take median instead of average for your new data you'll see it's perfectly match with 100mm in relevant part (From 0 to 100 is irelevant because all curves overlaping).

    I think that average is not good because point A25,B25 is so bouncing than rest of thata that it shouldn't determine graphs. And also, lack of points after that one particular.

    The median can be used as a measure of location when a distribution is skewed, when end values are not known, or when one requires reduced importance to be attached to outliers, e.g. because they may be measurement errors. That's why I think median is better.

    But in that case you get 100mm curve (again).

    I would like to see shg opinion because he's probably best mathematician here, and this belongs more to math domain rather than excel. After we see what result should be would be easier to implement it.
    Attached Files Attached Files
    Last edited by zbor; 03-04-2010 at 03:10 AM.

  8. #8
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Best Fit Curve

    zbor, I hear you and I (too) am not a statistical hero, but to me median is not correct as it will always take the middle value (100mm) in case of three values.
    if you take median instead of average for your new data you'll see it's perfectly match with 100mm
    Yes, by definition !! My feeling is that taking the median is not correct.

    Then you through in all sorts of statistical terms that relate to correlation and frequency graphs. Again, I am not an expert, but I do not see the relevance. A simple avg on interpolated values looked good enough to me.

    On the other point I agree, There are some arbitrary points, but I had to interpolate as non of the x-values is the same and then you'll end up with a margin of error.

    I hope Niall shows up to give us some pointers.

  9. #9
    Registered User
    Join Date
    03-01-2010
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Best Fit Curve

    thanks rwgrietveld,

    i thought there was a basic tool i could use on excel to do this! I've talking to my lecturer and yes it is a maths prob so i'm a bit out of my depth. the curve you posted looks like what i need. is there any chance you could give me a quick explaination of how you did it? thanks a million for your help

  10. #10
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Best Fit Curve

    For the interpolation you need to make sure that the new X is in between x1 and x0. The index / Match look up these values and determine the new Y Y=f(X).

    Y = X0 + (X-X1)*(Y1-Y0)/(X1-X0)

    Basically it's: y= a + bx where a=X0 and b (slope) =(Y1-Y0)/(X1-X0)

    That's it. It looks difficult, but in fact its not.
    Last edited by rwgrietveld; 03-04-2010 at 06:02 AM.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Best Fit Curve

    I never saw this post. niall, if you're still around, you can take all three series and stack them one below the other, and plot them as a single series. Then add a polynomial trendline, which produces a best fit the three.

    If you need the coefficients, you can get them with LINEST.

    If you know something about the phenomonon, you could choose a set of basis functions other than polynomials, and get a best fit to those.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1