+ Reply to Thread
Results 1 to 4 of 4

Formula to match Polynomial trendline

  1. #1
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Formula to match Polynomial trendline

    Hi Guys

    I need to forecast a future value.
    I have only two metrics, Month/year and the cost within each month

    Using the Forecast (and est variant) testing the accuracy of the formula does not meet actual values (ie if I retrospectively "test" the forecast against values now known values)

    However, I notice that a Polynominal trend line is a good match

    I think my requirement might NOT be what these functions were designed for (I want a line graph {for a future estimate timeline} rather than a scatter graph)

    I thought I could use the R square coefficient, so have googled the problem and the maths behind this was either directly relating to scatters or well over my head.
    Any ideas please
    Attached Files Attached Files
    Last edited by _MANNY_; 10-27-2019 at 10:39 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,056

    Re: Formula to match Polynomial trendline

    I can see what you are doing in your file but it is not clear what your question is.

    You have created a forecast using a polynomial model, and it's a good R2 match.

    What is the remaining problem?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

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

    Re: Formula to match Polynomial trendline

    See the 'Timeline (2)' worksheet in the attached file.

    Select B2:D2 and array-enter (press ctrl+shift+Enter instead of just Enter) the following:

    =LINEST(B6:BQ6, B5:BQ5^{1;2})

    Although the coefficients are slightly different, they are the same up to 11 to 12 decimal places, which we can see when we format the trendline label to display Scientific with 14 decimal places.

    To calculate the data for the trendline, enter the following formula into B7 and copy in C7:CJ7:

    =SERIESSUM(B5, 2, -1, $B$2:$D$2)

    The two data series (B6:BQ6 and B7:CJ7) are used to create "Calculated Line Chart" on the right.

    ----

    Sigh, I cannot resist some editorial comments.

    Generally, it is better to replace the date range in the chart with either an ordinal number series (1st, 2nd, 3rd, etc month) or a series of cardinal number of days since the first date (with 1 for the first date).

    Excel dates are in the range 41640 to 44256 for your dates. Although squaring them (B5:BQ5^2) is well within the limits of the internal binary representation that Excel uses, that might not be the case if you choose an order-4 polynomial or exponential trendline (for some other problem).

    In fact, I'm surprised that the Line Chart seems to have used the dates for its trendline. Usually, the problem with Line Chart trendlines is that they use an ordinal number series, no matter what the x-axis values are.

    For that reason, it is better to use a Scatter Chart with a Line subtype.
    Attached Files Attached Files
    Last edited by joeu2004; 10-26-2019 at 05:40 PM.

  4. #4
    Registered User
    Join Date
    12-28-2010
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    72

    Re: Formula to match Polynomial trendline

    This is brilliant - thank you very much - With the MS page open on the syntax of the formula It explains better than all google findings, which ironically all mentioned scatters like you allude to in your comments
    Thanks too, for the comments - ironically I had first tried using a "days count" in a row below the "mon-yy", but selected the wrong column when tapping in the formula. Seeing results and thinking these are just serial dates anyways, I went with it
    I have for many years used a date on a graph axis and trendlines without problem, but will bear in mind your experiences.

    I was a bit stumped about how and why the "three" coefficients (the maths approach is a bit over my head tbh), but looking at the trend label, the penny dropped!
    I'm guessing we could use the same thinking for a exponential trend line (I had put in a manually entered cell) but better we can link to a calculated one

    You have no idea how much time I have spent in researching this and the only thing I found was an increasing sense of overwhelming and highlights of my lack of maths knowledge.
    Embarrassingly, I did have a very large stretch graph where I visually took a guestimate about where the monthly intersections lay, surprisingly ridiculously close to these calculated one so I've every confidence this is bang on !! Cheers joeu2004

+ 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. Help please entering a formula obtained by a polynomial equation trendline
    By Help me, I'm Simon in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-16-2015, 02:51 PM
  2. [SOLVED] Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  3. [SOLVED] Polynomial trendline
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 02:05 PM
  4. Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] Polynomial trendline
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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