+ Reply to Thread
Results 1 to 7 of 7

3 variables fitting

  1. #1
    Registered User
    Join Date
    03-06-2015
    Location
    aswan , egypt
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3

    Question 3 variables fitting




    I am an electrical engineering. I have data sets that describe the relation between three variables. I want to do a fit to define a function that will describe the three variables:

    y = f(x1,x2)

    How would I go about doing this? Thanks in advance for any help.

    Ahmed
    Attached Files Attached Files
    Last edited by mohandespower2010; 03-09-2015 at 06:51 PM.

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

    Re: 3 variables fitting

    If f() is "linear" (in the broader sense that you may have learned in a linear algebra course), then you can use the LINEST() function to perform a least squares regression: https://support.office.com/en-us/art...a-fa7abf772b6d

    If f() is "non-linear", and you cannot manipulate it to make it linear, then you will need to use non-linear regression techniques. This will involve computing an "objective function", then calling Solver to optimize the objective function by changing the functions parameters.

    Do you know what kind of function f() should be?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: 3 variables fitting

    Have you choosen exponential trendline because of some theory behind or your supervisor suggestion?
    Especially for the second graph (Salinity) linear trend seems to be very obviuos choice.
    Try displaying for your trendlines equations and Rsquared values. They are much better (closer to 1) in case of linear trend.
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    03-06-2015
    Location
    aswan , egypt
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3

    Re: 3 variables fitting


    Thanks MrShorty for your attention,
    The function is non-linear.
    How can i compute the objective function? and i don't have any idea about the solver in excel or how to use it



    Quote Originally Posted by MrShorty View Post
    If f() is "linear" (in the broader sense that you may have learned in a linear algebra course), then you can use the LINEST() function to perform a least squares regression: https://support.office.com/en-us/art...a-fa7abf772b6d


    If f() is "non-linear", and you cannot manipulate it to make it linear, then you will need to use non-linear regression techniques. This will involve computing an "objective function", then calling Solver to optimize the objective function by changing the functions parameters.

    Do you know what kind of function f() should be?

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

    Re: 3 variables fitting

    The first step in computing the objective function is to choose one. A typical "least-squares" objective function will be sum[(known_y-equation_y)^2] or, in Excel, the SUMXMY2() function: https://support.office.com/en-us/art...4-e2ecee23b299 You will start by "guessing" some reasonable parameters for f, then use Solver to minimize the sum of squares by changing those parameters.
    My typical spreadsheet will look like:
    Please Login or Register  to view this content.
    Calling Solver should be as easy as following instructions here: https://support.office.com/en-US/art...d-078f96d1652c

    Let us know what you have trouble understanding or where you get stuck.

  6. #6
    Registered User
    Join Date
    03-06-2015
    Location
    aswan , egypt
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3

    Re: 3 variables fitting


    Thanks Mr Kaper

    Simplifying my question ,
    I need to make the three curves in the graph (either PVC CONTENT in EPDM OR Salinity) to be one curve with one function represents all the three curves

    Quote Originally Posted by Kaper View Post
    Have you choosen exponential trendline because of some theory behind or your supervisor suggestion?
    Especially for the second graph (Salinity) linear trend seems to be very obviuos choice.
    Try displaying for your trendlines equations and Rsquared values. They are much better (closer to 1) in case of linear trend.

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

    Re: 3 variables fitting

    To update others, after a few PM's here's where we are at:

    1) These numbers are "breakdown voltages" vs. PVC/EPDM ratio at different salinities. I'm not sure what the salinity is referring to (I would guess the insulator/polymer is in contact with an aqueous salt solution, but not sure). If there are any electrical engineering types on the forum who would know how breakdown voltages are typically modeled, it would help us understand what to use for the regression function.

    2) In the last PM, you indicated that you did not care what kind of function was used. So, in order to get things moving, let's start with the simplest function that comes immediately to mind -- a plane. y=m1*x1+m2*x2+b. You will need to become familiar with the LINEST() function, since chart trendlines cannot handle 3D data like this: https://support.office.com/en-us/art...a-fa7abf772b6d Note that example 3 specifically shows a multi-variable regression, so you should become familiar with how they did this example.

    3) The LINEST() function needs to have your data arranged in a list rather than a table. This should look something like:
    Please Login or Register  to view this content.
    4) Enter the LINEST() function. Remember that this is an array function, so it needs to be committed with ctrl-shift-enter.

    5) Evaluate regression to see if it is adequate.

    This should give us a starting place.
    Attached Files Attached Files
    Last edited by MrShorty; 03-13-2015 at 12:20 AM.

+ 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. Best-fitting an array
    By Parky102! in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-13-2015, 10:06 AM
  2. Excel 2007 : How to do a Data Fitting?
    By Nokia N93 in forum Excel General
    Replies: 3
    Last Post: 12-20-2011, 03:07 AM
  3. curve fitting
    By [email protected] in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-03-2006, 02:10 PM
  4. [SOLVED] Best fitting curve
    By ladee_bird in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2005, 09:05 AM
  5. [SOLVED] best curve fitting
    By ladee_bird in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-20-2005, 03:05 AM

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