How do I form a function of two variables from two separate single variable functions?

hspivey

New member
Joined
Jul 19, 2019
Messages
2
I'm trying to create a model for a data set that depends on two different variables, and first started by finding models that relate the variable i'm interested in (let's call it z) to the two other variables that z depends on (let's call them x and y).

So say these models were something like:
z = 6x^3 + 2x^2 + 3x + 5
z = 3y^4 + 8y^3 + y^2 + 4y + 1

How would I go about using these to get a function of the form z = f(x, y)?
My first instinct is to just add the two equations together and isolate z, but the resulting model doesn't seem like it works very well, which seemed odd considering both of my individual functions modeled the 2D relationship pretty well.
 
I'm trying to create a model for a data set that depends on two different variables, and first started by finding models that relate the variable i'm interested in (let's call it z) to the two other variables that z depends on (let's call them x and y).

So say these models were something like:
z = 6x^3 + 2x^2 + 3x + 5
z = 3y^4 + 8y^3 + y^2 + 4y + 1

How would I go about using these to get a function of the form z = f(x, y)?
My first instinct is to just add the two equations together and isolate z, but the resulting model doesn't seem like it works very well, which seemed odd considering both of my individual functions modeled the 2D relationship pretty well.
You need to have other "constraints". You can have infinite number of ways to combine these two functions

f(x) = z = 6x^3 + 2x^2 + 3x + 5
f(y) = z = 3y^4 + 8y^3 + y^2 + 4y + 1

so it could be:

z = [f(x) * f(y)](1/2)

Or,

z = [m * f(x) + n * f(y)] * [1/{m+n)] ....... and so on
 
I'm trying to create a model for a data set that depends on two different variables, and first started by finding models that relate the variable i'm interested in (let's call it z) to the two other variables that z depends on (let's call them x and y).

So say these models were something like:
z = 6x^3 + 2x^2 + 3x + 5
z = 3y^4 + 8y^3 + y^2 + 4y + 1

How would I go about using these to get a function of the form z = f(x, y)?
My first instinct is to just add the two equations together and isolate z, but the resulting model doesn't seem like it works very well, which seemed odd considering both of my individual functions modeled the 2D relationship pretty well.
You did not say how you developed your model using powers of a single independent variable.

If you used multiple regression software, start by using x and y without any powers. You will need to be careful about degrees of freedom as you add powers.
 
From the initial data set I started with I created scatter plots comparing my z variable to x and y separately, from this I used a regression function in Python to get trend-line equations that modeled the effects that x and y had on z. Does having the actual values of z along with these two trend-line equations enable me to find the "constraint" equation that combines the two that Subhotosh Khan was referring to?
 
I do not know Python's regression function. Excel has an extension that lets you do regression against multiple variables simultaneously, and there are undoubtedly web sites that will let you do multiple regression. (Multiple regression is simultaneous regression against more than one variable.)
 
Top