# Turning sample data with two variables into a continuous function

• Jun 7th 2011, 03:01 PM
Misa
Turning sample data with two variables into a continuous function
Hello~!

I dunno if I could have made that title better...
Anyway... me and a friend are trying to "break" some random computer game using the power of math (Surprised) (so, no, this is not "urgent" or anything like that...) and he's got some pretty cool data...
We'd like to turn that data into something like a continuous function where you plug any "x" and "y" (like, x = 82.66 and y = -5.7) and it returns a value f(x,y).

The data looks like this (pretty long block of numbers ahead):

x y f(x,y)
100 17 0,88706
100 15 0,86133
100 12 0,82333
100 9 0,79111
100 6 0,76167
100 3 0,74333
100 -3 0,69000
100 -6 0,66667
100 -9 0,64889
100 -12 0,62917
100 -16 0,60938
100 -20 0,59000
100 -25 0,56800
100 -30 0,54667
95 17 1,13706
95 15 1,09133
95 12 1,03083
95 9 0,98444
95 6 0,93500
95 3 0,89333
95 -3 0,84667
95 -6 0,81000
95 -9 0,78333
95 -12 0,75833
95 -16 0,72875
95 -20 0,70200
95 -25 0,67280
95 -30 0,64533
90 17 1,46059
90 15 1,38267
90 12 1,28500
90 9 1,20889
90 6 1,14333
90 3 1,09000
90 -3 0,99000
90 -6 0,95500
90 -9 0,92111
90 -12 0,89000
90 -16 0,85250
90 -20 0,81850
90 -25 0,78000
90 -30 0,74633
85 17 1,89235
85 15 1,74667
85 12 1,58667
85 9 1,46667
85 6 1,37000
85 3 1,29000
85 -3 1,16667
85 -6 1,11333
85 -9 1,06889
85 -12 1,02833
85 -16 0,98063
85 -20 0,93800
85 -25 0,89000
85 -30 0,84800
80 17 2,54824
80 15 2,23133
80 12 1,94833
80 9 1,76111
80 6 1,62333
80 3 1,51000
80 -3 1,34333
80 -6 1,27833
80 -9 1,22111
80 -12 1,16917
80 -16 1,11000
80 -20 1,05750
80 -25 1,00000
80 -30 0,94967

So, we've figured that this data is definitely not "chaotic" and that turning it into some continuous function should be somehow possible, but... how are we supposed to do it?
We've already done similar stuff with 1-variable functions with the aid of Graph... is there some other free program that could help us with that?

(also, sorry for this being my first post :P I'm not too much into taking and not giving anything in return, but I see that most of the questions that are within my level are answered very quickly... I guess that's a good thing.)
• Jun 7th 2011, 06:43 PM
TKHunny
Various models don't yield all that great a result.

f(x) = ax + by
f(x) = a/x + by
f(x) = aln(x) + by
f(x) = a/ln(x) + by

Pretty much the same result. Some clue might be good. Check some first and second differences and see if you can find some sort of pattern.

It does look like a quadratic relationship to 'y' is better than a linear relationship. I didn't test that. You have to do some work.
• Jun 9th 2011, 04:23 AM
CaptainBlack
Quote:

Originally Posted by Misa
Hello~!

I dunno if I could have made that title better...
Anyway... me and a friend are trying to "break" some random computer game using the power of math (Surprised) (so, no, this is not "urgent" or anything like that...) and he's got some pretty cool data...
We'd like to turn that data into something like a continuous function where you plug any "x" and "y" (like, x = 82.66 and y = -5.7) and it returns a value f(x,y).

The data looks like this (pretty long block of numbers ahead):

x y f(x,y)
100 17 0,88706
100 15 0,86133
100 12 0,82333
100 9 0,79111
100 6 0,76167
100 3 0,74333
100 -3 0,69000
100 -6 0,66667
100 -9 0,64889
100 -12 0,62917
100 -16 0,60938
100 -20 0,59000
100 -25 0,56800
100 -30 0,54667
95 17 1,13706
95 15 1,09133
95 12 1,03083
95 9 0,98444
95 6 0,93500
95 3 0,89333
95 -3 0,84667
95 -6 0,81000
95 -9 0,78333
95 -12 0,75833
95 -16 0,72875
95 -20 0,70200
95 -25 0,67280
95 -30 0,64533
90 17 1,46059
90 15 1,38267
90 12 1,28500
90 9 1,20889
90 6 1,14333
90 3 1,09000
90 -3 0,99000
90 -6 0,95500
90 -9 0,92111
90 -12 0,89000
90 -16 0,85250
90 -20 0,81850
90 -25 0,78000
90 -30 0,74633
85 17 1,89235
85 15 1,74667
85 12 1,58667
85 9 1,46667
85 6 1,37000
85 3 1,29000
85 -3 1,16667
85 -6 1,11333
85 -9 1,06889
85 -12 1,02833
85 -16 0,98063
85 -20 0,93800
85 -25 0,89000
85 -30 0,84800
80 17 2,54824
80 15 2,23133
80 12 1,94833
80 9 1,76111
80 6 1,62333
80 3 1,51000
80 -3 1,34333
80 -6 1,27833
80 -9 1,22111
80 -12 1,16917
80 -16 1,11000
80 -20 1,05750
80 -25 1,00000
80 -30 0,94967

So, we've figured that this data is definitely not "chaotic" and that turning it into some continuous function should be somehow possible, but... how are we supposed to do it?
We've already done similar stuff with 1-variable functions with the aid of Graph... is there some other free program that could help us with that?

(also, sorry for this being my first post :P I'm not too much into taking and not giving anything in return, but I see that most of the questions that are within my level are answered very quickly... I guess that's a good thing.)

Make a surface plot, any spreadsheet package will allow you to make such a plot. Then try a 2-variable quadratic surface.

CB
• Jun 9th 2011, 10:36 AM
Misa
Thanks, both of you! I'm short on free time so I still didn't look at that (maybe later today though)... however I figured that I should give you some word on how it's going (or not) :P

Quote:

Originally Posted by TKHunny
It does look like a quadratic relationship to 'y' is better than a linear relationship. I didn't test that. You have to do some work.

Yeah we're pretty sure that linear doesn't fit well.
When I have some time I'll try and figure out how to plot it... anyway now it's my turn to do something, then I'll get back to you (hopefully) to say that "it's solved" and how it turned out ^^
• Jun 9th 2011, 08:26 PM
Misa
No luck yet, but I guess that's due to my inability...
I couldn't get to do something helpful on OpenOffice's CALC, and some searching didn't help much... would you recommend some other free program (some statistic package?) or is it good enough and I should look harder?
• Jun 10th 2011, 04:13 AM
CaptainBlack
Quote:

Originally Posted by Misa
No luck yet, but I guess that's due to my inability...
I couldn't get to do something helpful on OpenOffice's CALC, and some searching didn't help much... would you recommend some other free program (some statistic package?) or is it good enough and I should look harder?

There are a number of ways of doing this, I think I would use the solver in Excel (if you have a machine with a copy of Excel), it could also be done with the non-linear solver in Gnumeric. Open/Libre Office if I recall correctly does not have a non-linear solver.

CB

CB