You are Here: Home >< Maths

# Deriving a z=y+x formula -STATISTICS watch

1. 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
2. Any ideas?

Posted from TSR Mobile
3. I am trying hard to understand the problem but I am confused as to what exactly you are trying to do.
4. (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
5. (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

And then substitute your xyz values in to get simultaneous equations to work out a, b and c and then k.
6. (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 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 where 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.
7. 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)

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.
8. (Original post by Kvothe the arcane)
Is it linear?
If so, you could say that

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.
9. (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 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 where 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...
10. (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'
library(e1071)

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.
11. (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...
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

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

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

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.

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: February 5, 2016
Today on TSR

### Summer Bucket List is Back!

Start yours and you could win £150!

Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams