The Student Room Group

Deriving a z=y+x formula -STATISTICS

How would I go about deriving a function of x and y (multivariate calculus) from a list of values for z, x and y. I'd like to be able to plot the graph (a surface on 3D space rather than a curve). I don't want to use a computer.

E.g
Z 1, 2, 3, 4...
X 0.5, 1.0, 1.5, 2.0...
Y 3, 9, 81, 6561...

Any help is much appreciated. Rep (and showerings of praise) available for the mathematics wizards amongst you haha
Reply 2
I am trying hard to understand the problem but I am confused as to what exactly you are trying to do.
Original post by TeeEm
I am trying hard to understand the problem but I am confused as to what exactly you are trying to do.


Create a formula that defines the relationship (or close enough) between z, x and y so one could predict other (z,x,y) values. Just like if I had a list of x values and y values and modelled a curve - just with z values as well.


Posted from TSR Mobile
Original post by RayApparently
How would I go about deriving a function of x and y (multivariate calculus) from a list of values for z, x and y. I'd like to be able to plot the graph (a surface on 3D space rather than a curve). I don't want to use a computer.

E.g
Z 1, 2, 3, 4...
X 0.5, 1.0, 1.5, 2.0...
Y 3, 9, 81, 6561...

Any help is much appreciated. Rep (and showerings of praise) available for the mathematics wizards amongst you haha


Is it linear?
If so, you could say that
Unparseable latex formula:

\emph{a}z+\emph{b}x+\emph{c}y=k



And then substitute your xyz values in to get simultaneous equations to work out a, b and c and then k.
Original post by RayApparently
Create a formula that defines the relationship (or close enough) between z, x and y so one could predict other (z,x,y) values. Just like if I had a list of x values and y values and modelled a curve - just with z values as well.


This is one of those questions where the devil is in the detail, so more information about what exactly you are trying to achieve will be very helpful in answering your question. So let me list a few of the possibilities:

1) If there is an exact linear relationship between z and (x,y), something like z=ax+byz = a x + b y then finding the values of a and b is a straightforward bit of equation solving.

2) If the relationship between z and (x,y) is linear, but involves the addition of random noise to z, something like zi=axi+byi+ϵiz_i = a x_i + b y_i + \epsilon_i where ϵi\epsilon_i is normal random noise, then the solution involves minimizing the least squares error, as one does in linear regression.

3) If the relationship between z and (x,y) is non-linear, then it really helps if you know beforehand what the likely form of the relationship is. Solving exact non-linear equations begins to get tricky, but if you've got a random noise component, then you can use extended techniques from linear regression as in (2).

4) If the relationship between z and (x,y) is non-linear, and you don't know beforehand what the form of the relationship should be, then you are into the realms of fitting the solution surface with things called splines.

So, let us know a little bit more about the problem and what you are trying to achieve and we'll do our best to help!

I note also that you wish to avoid using a computer...that will be a challenge for some of the situations above.
Reply 6
This is basicaly a nonparametric regression problem. You can use whatever technique for nonparametric regression that you like - support vector machines, CART, density estimation, whatever. Statistical programming languages like R/Matlab have built in packages that can fit most of these.

If you have R installed then try

install.packages('e1071')
library(e1071)
z <- #your Z
y <- #your Y
x <- #your X
fit <- svm(z~x+y, kernel="radial")

newx <- #the new x values to use for predicting
newy <- #the new y values to use for predicting
predict(fit,newx,newy)

that will give you a model which should be at least decent. To make it better, you would have to learn quite a lot more about statistics/machine learning.
(edited 8 years ago)
Original post by Kvothe the arcane
Is it linear?
If so, you could say that
Unparseable latex formula:

\emph{a}z+\emph{b}x+\emph{c}y=k



And then substitute your xyz values in to get simultaneous equations to work out a, b and c and then k.


I think there's a linear relationship between the z and x, an exponential relationship between z and y and the relationship between x an y is unknown (probably polynomial). The numbers are from RL data not some or existing formula so I'm not looking for a perfect fit, rather a model that roughly fits. Thanks for your response, appreciate it.
Original post by Gregorius
This is one of those questions where the devil is in the detail, so more information about what exactly you are trying to achieve will be very helpful in answering your question. So let me list a few of the possibilities:

1) If there is an exact linear relationship between z and (x,y), something like z=ax+byz = a x + b y then finding the values of a and b is a straightforward bit of equation solving.

2) If the relationship between z and (x,y) is linear, but involves the addition of random noise to z, something like zi=axi+byi+ϵiz_i = a x_i + b y_i + \epsilon_i where ϵi\epsilon_i is normal random noise, then the solution involves minimizing the least squares error, as one does in linear regression.

3) If the relationship between z and (x,y) is non-linear, then it really helps if you know beforehand what the likely form of the relationship is. Solving exact non-linear equations begins to get tricky, but if you've got a random noise component, then you can use extended techniques from linear regression as in (2).

4) If the relationship between z and (x,y) is non-linear, and you don't know beforehand what the form of the relationship should be, then you are into the realms of fitting the solution surface with things called splines.

So, let us know a little bit more about the problem and what you are trying to achieve and we'll do our best to help!

I note also that you wish to avoid using a computer...that will be a challenge for some of the situations above.


Interesting to look at the options. Basically I've got three lists of values (from nature so its a modelling problem - an equation won't fit exactly - or if there is one its beyond me). I know that there's an exponential relationship between y and x and a linear relationship between x and z. I did some rearranging and worked out there's also going to be an exponential relationship between y and z. I want to get one formula for x,y,z but don't know how to go about it. I think it has something to do with partial integrals but... :s-smilie:
Original post by poohat
This is basicaly a nonparametric regression problem. You can use whatever technique for nonparametric regression that you like - support vector machines, CART, density estimation, whatever. Statistical programming languages like R/Matlab have built in packages that can fit most of these.

If you have R installed then try

install.packages('e1071':wink:
library(e1071)
z <- #your Z
y <- #your Y
x <- #your X
fit <- svm(z~x+y, kernel="radial":wink:

newx <- #the new x values to use for predicting
newy <- #the new y values to use for predicting
predict(fit,newx,newy)

that will give you a model which should be at least decent. To make it better, you would have to learn quite a lot more about statistics/machine learning.


Interesting, but I want to use as little technological assistance as possible. It doesn't matter if there's a few problems with the model.
Original post by RayApparently
Interesting to look at the options. Basically I've got three lists of values (from nature so its a modelling problem - an equation won't fit exactly - or if there is one its beyond me). I know that there's an exponential relationship between y and x and a linear relationship between x and z. I did some rearranging and worked out there's also going to be an exponential relationship between y and z. I want to get one formula for x,y,z but don't know how to go about it. I think it has something to do with partial integrals but... :s-smilie:


If you're looking to avoid using a computer for this problem, then the easiest approach is probably going to be a least squares fit to a predefined functional form z = f(x ,y).

If there is an unconditional linear relationship between x and z, then we have

z=cx+d\displaystyle z = c x + d

If there is an unconditional exponential relationship between y and x, then we can write this as a log-linear relationship

logy=a+bx\displaystyle \log y = a + b x

Both of these equations can be solved using linear regression (i.e. least squares).

However, notice the use of the word unconditional in the above. I've assumed that the values of a, b, c, d are constants. It might be the case that (for example) c and d are themselves functions of y

z=c(y)x+d(y)\displaystyle z = c(y) x + d(y)

That means that z still depends linearly on y, but the magnitude of the relationship varies with y. If this happens, then the results that you will get from the two regression equations above will give you inconsistent results.

So what I'm saying is (the tl;dr version) we need more information about the data before we can give you definitive advice. Are you able to post an excerpt from it? I'm quite happy to have a look at it.

Quick Reply

Latest