+ Reply to Thread
Results 1 to 7 of 7

Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

  1. #1
    Registered User
    Join Date
    10-23-2014
    Location
    new jersey
    MS-Off Ver
    2013
    Posts
    4

    Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    Hey guys,

    I'm creating an algorithm for daily fantasy basketball and I have hit a little roadblock.

    Here is the link to download my spreadsheet:

    Linest Solver.xlsx


    Now the data at the top is pulled from a database I have created on another sheet that I have omitted for these purposes. So the premise is, each playe'r's performance in basketball can be predicted by a different set of statistics. In the B column I have listed some of the ones I have come up with so far. The "Actual" data is the Y data for the Linest function I wish to run.

    This will be a much easier question to answer if you download the file. I have put 0's or 1's in the A column beside each of the data types. I then have a data array beginning in B17 that displays the rows with 1's next to them as adjacent columns. Then starting in D30, I run a dynamic Linest Function on the displayed array using offset functions and row/column count functions in order to select the data displayed in the step in the previous sentence.

    ANYWAY, if you MANUALLY change the 0's and 1's the data does change with it and everything is accurate. If you make all the rows a 1, then all the rows will display as adjacent columns below, if only 7 then 7 adjacent columns will show, etc.

    Having only a working knowledge of using solver at THIS level (I've done basic binary situations before), I cannot spot the reason why the solver wont change the 0's and 1's to maximize the R squared value in D32. Again, if I manually change the 0's and 1's I can maximize this value with trial and error, but I thought that was what the iterations in Solver were for.

    If you have any suggestions about how I can go about fixing this PLEASE let me know, as manually doing these situations would be impossible due to the volume required (this is on one player's data). And PLEASE download the file so that your answer does not depend fully on my explanation.
    Last edited by smeador; 12-03-2014 at 02:18 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    Why not attach it directly (Go Advanced) on your post and make it available here so those who help do not have to go to another site to assist.
    -If you think you are done, Start over - ELeGault

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-23-2014
    Location
    new jersey
    MS-Off Ver
    2013
    Posts
    4

    Re: Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    sorry guys, I missed the "go advanced" button. New here

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    Solver should have no problem with the "LINEST" function but you have added the "IF ERROR" as well and that I think makes the "Object function" discontinuos.

    A nonlinear solver relies on (partial) derivative values to guide it towards a feasible and optimal solution; since it is unable to compute the derivatives of a function at points where that function is discontinuous, it has trouble determining how to proceed.
    In practice, the nonlinear GRG Solver used in Excel can sometimes deal with discontinuities which are "incidental" to the problem, but as a general statement, the nonlinear Solver cannot be expected to find optimal solutions to such problems. However, the Evolutionary Solver included in Frontline's enhanced Solver products can make progress on these problems.
    If you try to solve a problem with discontinuous functions with the Assume Linear Model box checked, it is possible -- though unlikely -- that the linearity test performed by the Solver will not detect the discontinuities and will proceed to try to solve the problem. (This probably means that the functions were linear over the range considered by the linearity test -- but there are no guarantees at all that the solution found is optimal!)
    You can use discontinuous functions such as IF and CHOOSE in calculations on the worksheet which are not dependent on the decision variables, and are therefore constant in the optimization problem. But any discontinuous functions that do depend on the variables will likely cause problems for the Solver. Users sometimes fail to realize that certain functions, such as ABS and ROUND, are nonsmooth at certain points.
    Still I could run your model selecting the "Evolutionary" model. Question why has the range "A3:A13" two constraints i.e. as binary and as integer? I would think that just binary would be sufficient.

    Alf

  6. #6
    Registered User
    Join Date
    10-23-2014
    Location
    new jersey
    MS-Off Ver
    2013
    Posts
    4

    Re: Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    Without the IFerror, running the solver on GRG NonLinear or Simplex returns an error message stating that it detects an error in the object or constraint cells

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Maximize R squared using solver DOCUMENT ATTACHED (may be difficult)

    Did you try to run solver using the "Evolutionary" methode?

+ 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] HELP! How to adjust headcount formula in attached document?
    By PWM in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-28-2014, 08:14 PM
  2. Using Solver to Maximize a value
    By Sirelsalot in forum Excel General
    Replies: 1
    Last Post: 04-14-2012, 08:24 PM
  3. Solver does not maximize
    By clegane in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-28-2011, 02:10 AM
  4. Solver-problem. Does not maximize anything
    By clegane in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2011, 09:22 AM
  5. Minimize SSE (Sum of Squared Errors) w/o Solver Tool
    By John Bates in forum Excel General
    Replies: 6
    Last Post: 03-31-2011, 12:10 PM

Tags for this Thread

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