+ Reply to Thread
Results 1 to 2 of 2

Non linear fit by iteration

  1. #1
    Registered User
    Join Date
    09-03-2011
    Location
    Novi Sad
    MS-Off Ver
    Excel 2007
    Posts
    4

    Non linear fit by iteration

    Hi everyone,

    I'm looking for a code that will change value of parameters A and B ( cells E2 and F2) in such a way that R approaches 1 as much as it is possible.

    Thank you!
    Attached Images Attached Images

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

    Re: Non linear fit by iteration

    1st thought, you are trying to create a routine that has already been included in Excel. Rather than write my own routine, I prefer to use the Solver add-in for non-linear regressions in Excel. If you didn't include the Solver add-in when you installed Excel, go back to your installation source, and tell Office to install Solver.

    Then you set up the spreadsheet just like you have it (with worksheet functions instead of filling in values by VBA). Column 3 is your calculated y at your best first guess for A and B. Column 4 is your squared deviations. r1c7=1-.01*sqrt(average(r2c4:r11c4)). Usually I set up my regressions to minimize the sum of the squared deviations rather than, so I'm not sure exactly how to set up the objective function on R. Maybe add a cell that is "=1-r2c7" Once you have the objective function figured out, you call Solver; tell it to "Set target cell r2c8" "to a minimum" "by changing R2c5:r2c6." If you've set up the spreadsheet correctly and given it reasonably starting values for A and B, Solver can usually converge on a good solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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