• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Math Problem -- Suggestions?

Quad

Golden Member
I have 4 input variables and 1 output variable. I have a several sets of data, that is I have values for the 4 input variables and the corresponding value for the output variable. I need to come up with formula that will use these 4 input variables to give me approximately the right answer (ie. the correct output). It only has to be an estimation and the function doesn't have to yield the exact outputs that I have, just something close 🙂

ie. I have sets of data like this (I'm making these up btw)
1) a=3,b=4,c=5,d=6 and output f =10
2) a=2,b=1,c=7,d=2 and output f = 14
3) ...etc

and I need a function f(a,b,c,d) to yield the correct values of f given a,b,c,d.

If I only had 2 inputs, then I was thinking of just graphing the data points, looking at the curve and estimating what the function is (ie. linear, exponential, quadratic etc)...but I'm not sure what to do now that I have four variables.

Thanks a ton for the help!
 
Is this for school or work? If it's for work get Matlab with the Optimization toolbox (I think that's the one) or something similar. A guy I work with uses this to model chips by feeding in different input and output data and letting matlab figure out what's going on.
 
Don't even need the Optimization toolbox with Matlab, type in your variables into a Nx4 matrix and type type your output into a Nx1 matrix, then use the \ command and you'll get a matrix that tells you the coefficients of A, B, C, and D.
 
Yes. You can do that with relatively simple linear algebra using matrices. You enter your inputs in a row and then tack on the output to the end of the row. You do that will however many data sets you have by adding rows as you add more data. You can then reduce the matrix to get the necessary coefficients for each function.
 
it seems likely that you wont find a set of coefficients that will yield those exact outputs. in all likeliness you'll have to do a least squares estimation of the coefficients (linear model).

have fun.
 
Yeah but I think he want's a *function*, and it may not be simple linear combinations that get you the answer.

Edit: Yes, I agree with maziwanka, if you want a linear model, do least squares. If that doesn't give you good enough answers, I know matlab with the opt. toolbox will come up with some pretty good stuff.
 
Back
Top