Michdd Posted January 2, 2009 Share Posted January 2, 2009 I need to find the formula used to get the second number from the first number. 1: 150 2: 652 3: 1569 4: 2972 5: 4946 6: 7588 15: 87367 33: 1729986 51: 19807601 56: 37665273 Quote Link to comment Share on other sites More sharing options...
corbin Posted January 2, 2009 Share Posted January 2, 2009 As often as you make these posts, you should find a regression calculator.... lol Looks like quartic regression is the best fit. (By about .01 on r^2 ;p) f(x) = 25.19668159x^4 - 1982.251758x^3 + 51051.54035x^2 - 410889.2313x + 740630.6288 R^2 = .9994005246 Quote Link to comment Share on other sites More sharing options...
Michdd Posted January 2, 2009 Author Share Posted January 2, 2009 As often as you make these posts, you should find a regression calculator.... lol Looks like quartic regression is the best fit. (By about .01 on r^2 ;p) f(x) = 25.19668159x^4 - 1982.251758x^3 + 51051.54035x^2 - 410889.2313x + 740630.6288 R^2 = .9994005246 I've actually been trying to figure out the same thing throughout all these posts. The other formula I got turns out it only worked for the first few. So I decided to get more numbers to make this more accurate.. How do I render the formula that works from that function you gave me? Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 2, 2009 Share Posted January 2, 2009 function points($level) { return 740630.6288 + $level * (410889.2313 + $level * (51051.54035 + $level *(1982.251758 + $level * 25.19668159))); } Quote Link to comment Share on other sites More sharing options...
Michdd Posted January 2, 2009 Author Share Posted January 2, 2009 function points($level) { return 740630.6288 + $level * (410889.2313 + $level * (51051.54035 + $level *(1982.251758 + $level * 25.19668159))); } That doesn't work.. if I input 1 for example it outputs: 1204578.84889 It should be outputting 150.. Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 2, 2009 Share Posted January 2, 2009 Sorry... messed up the signs function points($level) { return 740630.6288 + $level * (-410889.2313 + $level * (51051.54035 + $level *(-1982.251758 + $level * 25.19668159))); } Quote Link to comment Share on other sites More sharing options...
Michdd Posted January 2, 2009 Author Share Posted January 2, 2009 Sorry... messed up the signs function points($level) { return 740630.6288 + $level * (-410889.2313 + $level * (51051.54035 + $level *(-1982.251758 + $level * 25.19668159))); } That has the same effect.. Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 2, 2009 Share Posted January 2, 2009 It starts giving prety good approximations once $level is over thirty something. R^2 close to 1 does not imply all reuslts will be close to real data points. Quote Link to comment Share on other sites More sharing options...
corbin Posted January 2, 2009 Share Posted January 2, 2009 Where did this set come from Michdd? If it's like an experience table from a game or something, there there is a good chance the original creator used an equation of some kind. Obviously quartic doesn't fit your data when x is low, but it was the closest fit that my calculator could figure. It could be some kind of weird function for all we know. Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 2, 2009 Share Posted January 2, 2009 Most likely it is a function of more than one variable, that's why trying to approximate it with single variable function gives pretty lousy results. Quote Link to comment Share on other sites More sharing options...
corbin Posted January 2, 2009 Share Posted January 2, 2009 That would explain it.... Quote Link to comment Share on other sites More sharing options...
Michdd Posted January 2, 2009 Author Share Posted January 2, 2009 I thought it was some type of exponential function. Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 2, 2009 Share Posted January 2, 2009 I tried exponential match, but it wasn't any better. Quote Link to comment Share on other sites More sharing options...
corbin Posted January 3, 2009 Share Posted January 3, 2009 I tried everything a TI-83 calculator can do.... (Yeah, I actually got out a calculator. Messed up, eh?) None of them fit better than quartic, and I would expect most of them to be inaccurate when x is small. Just wondering... What exactly is this data from? A game? Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted January 4, 2009 Share Posted January 4, 2009 Well my PHP best fit routines give: Linear: Y = -3356182.0813 + 527670.027346 * X Goodness of fit (R2) = 0.770107920425 Exponential Y = 988.824767691 * 1.22215715614^X Goodness of fit (R2) = 0.0133880717857 Logarithmic Y = -7352389.96876 + 6404324.35463 * log(X) Goodness of fit (R2) = 0.494025408661 Power Y = 55.7661392554 * X^3.08867545849 Goodness of fit (R2) = 0.556663601401 2nd Order Polynomial Y = 2462965.17606 + -735312.020309 * X + 22975.8285934 * X^2 Goodness of fit (R2) = 0.956647178838 3rd Order Polynomial Y = -1314023.33251 + 546488.096084 * X + -40019.3995475 * X^2 + 753.074489922 * X^3 Goodness of fit (R2) = 0.990972453353 4th Order Polynomial Y = 740630.628802 + -410889.231328 * X + 51051.5403512 * X^2 + -1982.25175809 * X^3 + 25.1966815902 * X^4 Goodness of fit (R2) = 0.999400524594 5th Order Polynomial Y = -54987.569198 + 54314.9019047 * X + -13486.4094351 * X^2 + 1156.42543951 * X^3 + -36.7871254933 * X^4 + 0.427917621793 * X^5 Goodness of fit (R2) = 0.999999462817 6th Order Polynomial Y = 1949.25791698 + -2884.08436671 * X + 1417.54916073 * X^2 + -213.282939974 * X^3 + 16.3830775025 * X^4 + -0.479307843025 * X^5 + 0.00563166434849 * X^6 Goodness of fit (R2) = 0.999999999856 Even the 6th Order polynomial isn't accurate for the low values though 1 => 285.349172354 2 => 392.17412227 3 => 1510.97083927 4 => 3169.92277 5 => 5136.77878991 6 => 7375.52805619 15 => 87373.7131515 33 => 1729985.46426 51 => 19807601.1832 56 => 37665272.9156 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.