+ Reply to Thread
Results 1 to 5 of 5

Trendline and linest gives incoherent results

  1. #1
    Registered User
    Join Date
    07-10-2019
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    4

    Trendline and linest gives incoherent results

    Dear all,

    1. I use a X Y scatter plot to draw simple x,y data
    2. draw 6th order trendline
    3. compute with linest formula the 7 coefficients of the 6th order polynomial function
    4. draw the polynomial function

    -> 4 and 2 are not exactly the same

    5. So to check, I extract by hand the polynomial coefficients from the equation displayed on the graph
    6. replot a trendline
    ->6 and 2 has nothing to see with the trendline given by excel...

    Please see attached xlsx file for the full example.

    I'm getting crazy! I already thank you for your help
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Trendline and linest gives incoherent results

    Using large order regression, I would look to use more robust tools. it is probably to do with internal calculation

    The link when I paste your data in gives virtually the same result as the equation on the graph
    http://polynomialregression.drque.net/online.php

    f( x ) = -6450.691967809926 + 261.56460139299855x - 4.4067880961407955x2 + 0.039488011253235866x3 - 0.0001984988163165764x4 + 5.3075574438874e-7x5 - 5.8976682292e-10x6

  3. #3
    Registered User
    Join Date
    07-10-2019
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    4

    Re: Trendline and linest gives incoherent results

    Thank you davsth for your quick reply,

    Well it is interesting to see that other codes give same results, but still when I plot the polynomial function I get a crazy plot(grey curve in the plot)...
    Attachment 631604

    EDIT: I've used coef. given on the web site you shared. It gives the good correlation. But it makes the analysis of my data on excel very tedious. Can I get the trendline coef. via VBA?
    Last edited by olhey; 07-10-2019 at 04:27 AM.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Trendline and linest gives incoherent results

    The problem I see is that, when you copied the trendline coefficients into the spreadsheet, you did not copy the coefficients to their full precision. for example, your x^6 coefficient is entered with only 4 significant figures -- -5.902e-10 The trendline shows this coefficient as -5.90204727382485e-10. I expect that, if you will copy the trendline coefficients into the spreadsheet to their full precision, you will get adequate results.

    The LINEST() coefficients seem to give an adequate fit of the data as well. LINEST()'s colinearity algorithm appears to have kicked in and decided that the x^1 term was colinear with one of the other terms and it forced the x^1 coefficient to 0, which necessarily changes the other coefficients, but it still gives and equivalent fit. Why do you prefer the chart trendline over the LINEST() trendline? I would also be curious if there is a way to override the colinearity algorithm so that it will give the same coefficients as the other regression algorithms.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    07-10-2019
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    4

    Re: Trendline and linest gives incoherent results

    Sad solution:

    I created (with the help of other posts) a macro that isolate coefficient from the trend line string equation, it is dirty but it works quite efficiently.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Produce Power trendline statistics via Linest
    By jeffreybrown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2018, 10:35 PM
  2. [SOLVED] Adding a Polynomial Trendline Using Linest
    By danielexcelvba in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-18-2018, 01:53 PM
  3. Linest and chart trendline show different results
    By VictorOnline in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-01-2016, 11:28 AM
  4. Linest not matching the Chart Polynomal Trendline
    By TSchulz85 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2014, 01:14 PM
  5. Linest different from trendline
    By Fishhooky in forum Excel General
    Replies: 6
    Last Post: 10-16-2012, 06:26 AM
  6. Trendline Coefficients Differ from Linest
    By jzmuda in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-28-2009, 04:44 PM
  7. Why does LINEST vs. Trendline give different values?
    By gshock in forum Excel General
    Replies: 5
    Last Post: 09-02-2008, 03:57 PM

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