+ Reply to Thread
Results 1 to 7 of 7

Excel Solver-Polynomial Coefficients Resolved to Zero

  1. #1
    Registered User
    Join Date
    02-03-2021
    Location
    Georgia
    MS-Off Ver
    16.45
    Posts
    3

    Excel Solver-Polynomial Coefficients Resolved to Zero

    Hello,

    I am using Excel Solver to resolve the best fit of a polynomial function to a known data set by altering the coefficients (weights) of the polynomial. The problem I have is most of the weights are resolved to zero and this producing a flat line (which does not fit the data well at all). What could be the cause of this?

    For instance, in the polynomial function, y=(w*(0))+(w*(1)*(x))+(w*(2)*(x^2)), I have set the Objective cell to the sum of the squared error value and the weights, w*(0), w*(1), and w*(2), as the Changing Variable cells. The weights are set to values that approximately fit the known data set. When I run solver, I indicate I want a min value of the objective cell. The solution solver provides is w*(0)=non zero value and w*(1) and w*(2)= zero.

    I have another sheet in excel in which I am performing the exact form of fitting but with a cubic polynomial, y=(w*(0))+(w*(1)*(x))+(w*(2)*(x^2))+(w*(3)*(x^3)).

    Attached is the excel file.

    I appreciate any feedback
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    397

    Re: Excel Solver-Polynomial Coefficients Resolved to Zero

    You should uncheck the option "Make Unconstrained Variables Non-Negative".

    HTH,

    Francesco
    Aim high or don't even try.
    ---------------------------------
    If your question has been answered, don't forget to mark the thread as SOLVED.
    If you find an answer helpful, click on the star icon at the bottom of the post.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Excel Solver-Polynomial Coefficients Resolved to Zero

    Is this going to produce a "better" result than using LINEST to return the polynomial fit parameters?

    For the cubic polynomial, the formula used is:


    =INDEX(LINEST($B$3:$B$13,$A$3:$A$13^{1,2,3}),ROWS(K$1:K1))

    copied down for 4 rows. See orange-shaded cells in the 3rd sheet.


    You seem to be using an older version of Excel than me. The formulae are almost certainly enclosed within a pair of { }. These are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    02-03-2021
    Location
    Georgia
    MS-Off Ver
    16.45
    Posts
    3

    Re: Excel Solver-Polynomial Coefficients Resolved to Zero

    Hello Glenn and Hydraulics,

    Yes, it is solving correctly now after I've unchecked "Make Unconstrained Variables Non-Negative".

    Thank you for all your help!

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Excel Solver-Polynomial Coefficients Resolved to Zero

    It's a lot quicker to use the Excel LINEST formula to calculate those parameters, though....

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

  6. #6
    Registered User
    Join Date
    02-03-2021
    Location
    Georgia
    MS-Off Ver
    16.45
    Posts
    3

    Re: Excel Solver-Polynomial Coefficients Resolved to Zero

    Hi Glenn, I have been familiarizing myself with it! It definitely requires many less steps.

    Thanks again.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Excel Solver-Polynomial Coefficients Resolved to Zero

    It can be adapted for any order of polynomial with a few keystrokes. if you need anything further regarding implementation, just shout.

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

+ 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. Extract polynomial coefficients with LinEst in VBA
    By shamedt in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-22-2011, 08:45 PM
  2. Replies: 5
    Last Post: 06-25-2009, 10:25 AM
  3. Polynomial coefficients
    By kc27315 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2008, 04:51 PM
  4. how to get coefficients for Polynomial regression as for rgp()
    By AZ in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-26-2006, 08:30 AM
  5. Extracting Polynomial Coefficients
    By Ken Hardman in forum Excel General
    Replies: 6
    Last Post: 09-06-2005, 11:05 PM
  6. [SOLVED] How to calculate polynomial regression coefficients
    By Joham Shason via OfficeKB.com in forum Excel General
    Replies: 8
    Last Post: 08-08-2005, 07:05 PM
  7. Replies: 1
    Last Post: 01-12-2005, 06:35 PM
  8. extract coefficients of polynomial regression?
    By shepman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2005, 12:53 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