+ Reply to Thread
Results 1 to 5 of 5

Linest not matching the Chart Polynomal Trendline

  1. #1
    Registered User
    Join Date
    08-29-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    1

    Linest not matching the Chart Polynomal Trendline

    Hi,

    I'm trying to do a Polynomial Regression, and managed to do it. However, I do get different values from those if I do a polynomial trendline with the Excel regression chart. I think I checked everything but still don't find my problem. Anyone has an idea what I'm doing wrong?
    Please refer to the attached sheet.

    Thanks a lot,
    Tobias
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,345

    Re: Linest not matching the Chart Polynomal Trendline

    It appears to me that the LINEST() function is detecting near collinearity with the x^1 term and forcing that coefficient to 0. The regression algorithms for the chart trendline appear to not detect the same collinearity.

    Entering the chart trendline coefficients into the spreadsheet and calculating the estimate with those coefficients appears to give the exact same results -- so my guess is that LINEST() is correctly detecting the collinearity and that the two regressions are equivalent.

    Discussion of the LINEST() function including a little about collinearity: http://support.microsoft.com/kb/828533
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Linest not matching the Chart Polynomal Trendline

    Quote Originally Posted by TSchulz85 View Post
    I'm trying to do a Polynomial Regression, and managed to do it. However, I do get different values from those if I do a polynomial trendline with the Excel regression chart. I think I checked everything but still don't find my problem. Anyone has an idea what I'm doing wrong?
    I suggest that you array-enter the following modified formula into BM4:BS4:

    =LINEST(D4:BK4,(D3:BK3-D3)^{1;2;3;4;5;6})

    D3:BK3 have very large numbers (dates?). So for example, BK3^6 is a very large number relative BK3^1. I suspect this causes arithmetic differences internally within LINEST.

    You might note that even with that change, LINEST returns different coefficients. That is allowed. The question is: do the LINEST coefficients and the trendline coefficients produce about the same "best fit" curve?

    [EDIT] Even (BK3-D3)^6 is very large relatively. So even with that change, LINEST might still fail to produce reasonable coefficients. But give it a shot.

    BTW, a simpler formula for D5 is (normally-entered; just press Enter):

    =SUMPRODUCT($BM$4:$BS$4*D3^{6,5,4,3,2,1,0})

    To compare, be sure to format the trendline "label" to always show coefficients with 15 significant digits. I prefer the Scientific format with 14 decimal places. Then copy and paste the trendline coefficients into Excel.

    Note: I believe it is possible to have different "best fit" curves. But I would expect their RSQs to be reasonably close. I do not have the time now to try this with your example.
    Last edited by joeu2004; 08-29-2014 at 12:48 PM.

  4. #4
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Linest not matching the Chart Polynomal Trendline

    ERRATA:
    Quote Originally Posted by joeu2004 View Post
    I suggest that you array-enter the following modified formula into BM4:BS4:

    =LINEST(D4:BK4,(D3:BK3-D3)^{1;2;3;4;5;6})
    The formula must be:

    =LINEST(D4:BK4,[B][COLOR="#FF0000"](D3:BK3-D3+1)^{1;2;3;4;5;6})

    to be used with the simpler formula suggested for D5.

    Quote Originally Posted by joeu2004 View Post
    BTW, a simpler formula for D5 is (normally-entered; just press Enter):

    =SUMPRODUCT($BM$4:$BS$4*D3^{6,5,4,3,2,1,0})

    Use that formula when BM4:BS4 contains the trendline coefficients.

    But for the modified LINEST formula, use the following formula to generate the "best fit" curve:

    =SUMPRODUCT($BM$4:$BS$4*(D3-$D$3+1)^{6,5,4,3,2,1,0})

    The expression D3-$D$3+1 will make more sense when the formula is copied to the right.

  5. #5
    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: Linest not matching the Chart Polynomal Trendline

    I think charts and LINEST use different algorithms. Both give about the same r2.
    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)

Similar Threads

  1. Linest different from trendline
    By Fishhooky in forum Excel General
    Replies: 6
    Last Post: 10-16-2012, 06:26 AM
  2. [SOLVED] Difference between trendline result in a graph and LINEST (polynomial 4 example)
    By derik111 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-01-2012, 04:26 AM
  3. Want to easily change my polynomial trendline using linest
    By baxter78 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-02-2010, 01:30 AM
  4. Trendline Coefficients Differ from Linest
    By jzmuda in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-28-2009, 04:44 PM
  5. 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