Michdd Posted December 25, 2008 Share Posted December 25, 2008 I need to figure out the relation, or a formula for these, so I can render more... Lvl1:Total EXP: 150 Lvl2:Total EXP: 750 Lvl3:Total EXP: 1665 Quote Link to comment Share on other sites More sharing options...
corbin Posted December 26, 2008 Share Posted December 26, 2008 Where did it come from? That would probably help. Other than that, your best bet would be finding different types of regression and seeing which one fits the most closely. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 26, 2008 Share Posted December 26, 2008 Not easy to work out with just 3 data points.... a few more would be useful. Linear: y = 757.5 * x + -660 Goodness of fit (R2) = 0.985794356397 Exponential y = 51.5465109855 * 3.33166624979^x Goodness of fit (R2) = 0.922426601723 Logarithmic y = 1323.72896595 * ln(x) + 64.3986968534 Goodness of fit (R2) = 0.929101044641 Power y = 153.313222805 * x^2.20500567242 Goodness of fit (R2) = 0.994945588215 Quote Link to comment Share on other sites More sharing options...
Michdd Posted December 26, 2008 Author Share Posted December 26, 2008 those figures I originally posted were a bit off. I didn't know. Here are the real figures: 1 - 151 2 - 652 3 - 1568 Quote Link to comment Share on other sites More sharing options...
Michdd Posted December 26, 2008 Author Share Posted December 26, 2008 EDITEDIT: These are the closest figures that I could find: 1 - 150.00015 2 - 651.99795 3 - 1568.99168 Quote Link to comment Share on other sites More sharing options...
Michdd Posted December 26, 2008 Author Share Posted December 26, 2008 EDITEDIT: These are the closest figures that I could find: 1 - 150.00015 2 - 651.99795 3 - 1568.99168 Next number in there is 2971.98848 So: 1 - 150.00015 2 - 651.99795 3 - 1568.99168 4 - 2971.98848 Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 26, 2008 Share Posted December 26, 2008 1 - 150.00015 2 - 651.99795 3 - 1568.99168 4 - 2971.98848 From those figures, it's a power series: Y = 148.771289841 + X^2.15106867905 Goodness of fit (R2) = 0.999654455365 5 -> 4742.98348305 6 -> 7020.62717237 7 -> 9780.99536149 8 -> 13035.5005931 9 -> 16794.2379656 10 -> 21066.2778238 Quote Link to comment Share on other sites More sharing options...
Michdd Posted December 26, 2008 Author Share Posted December 26, 2008 1 - 150.00015 2 - 651.99795 3 - 1568.99168 4 - 2971.98848 From those figures, it's a power series: Y = 148.771289841 + X^2.15106867905 Goodness of fit (R2) = 0.999654455365 5 -> 4742.98348305 6 -> 7020.62717237 7 -> 9780.99536149 8 -> 13035.5005931 9 -> 16794.2379656 10 -> 21066.2778238 I'm not quite to sure how that works.. Are you just plugging the number into the equation Y = 148.771289841 + X^2.15106867905 as X and getting Y? Because then that doesn't make sense.. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 27, 2008 Share Posted December 27, 2008 I'm not quite to sure how that works.. Are you just plugging the number into the equation Y = 148.771289841 + X^2.15106867905 as X and getting Y? Because then that doesn't make sense..To get the next values in the series, yes! You wanted the formula for the relationship between Level and Total EXP. That formula is: Total EXP = 148.771289841 + Level^2.15106867905 The trick was deriving the formula from the 4 data points in the series that you provided; but the work I'm currently doing is a package of classes for linear and non-linear regression... for calculating a best-fit formula from a series of data values. Quote Link to comment Share on other sites More sharing options...
Michdd Posted December 27, 2008 Author Share Posted December 27, 2008 I'm not quite to sure how that works.. Are you just plugging the number into the equation Y = 148.771289841 + X^2.15106867905 as X and getting Y? Because then that doesn't make sense..To get the next values in the series, yes! You wanted the formula for the relationship between Level and Total EXP. That formula is: Total EXP = 757.5 * Level - 660 The trick was deriving the formula from the 4 data points in the series that you provided; but the work I'm currently doing is a package of classes for linear and non-linear regression... for calculating a best-fit formula from a series of data values. That still doesn't make sense. For example if I plug 10 into there I get 6915 Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 27, 2008 Share Posted December 27, 2008 Total EXP = 757.5 * Level - 660 That still doesn't make sense. For example if I plug 10 into there I get 6915 Formula should have read: Total EXP = 148.771289841 + Level^2.15106867905 I'm using the same test script with multiple regressions -Linear, Logarithmic, Exponential and Power - to work out a best fit for each, and I had this Level/Experience data on a page with my own test data as well... and I cut and pasted the wrong one. Quote Link to comment Share on other sites More sharing options...
Michdd Posted December 27, 2008 Author Share Posted December 27, 2008 I feel really stupid. But I'm confused... For example: 148.771289841 + (10^2.15106867905) = 290.373059 Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 27, 2008 Share Posted December 27, 2008 I feel really stupid. But I'm confused... For example: 148.771289841 + (10^2.15106867905) = 290.373059 You're right, I've gone wrong again. Multiplication rather than addition for power values: Total EXP = 148.771289841 * Level^2.15106867905 Quote Link to comment Share on other sites More sharing options...
corbin Posted December 27, 2008 Share Posted December 27, 2008 I feel really stupid. But I'm confused... For example: 148.771289841 + (10^2.15106867905) = 290.373059 You're right, I've gone wrong again. Multiplication rather than addition for power values: Total EXP = 148.771289841 * Level^2.15106867905 If by power you mean exponential, that's not exponential. Exponential: f(x) = x^a +c, x != 1 Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 27, 2008 Share Posted December 27, 2008 If by power you mean exponential, that's not exponential. No, I do mean a power regression. With a power regression, you apply the log to both the X and Y values before doing the least square fitting. For an exponential regression, you apply the log only to the Y values before doing the least square fitting. And the equation for an Exponential regression is Y = 70.2572663284 * e(2.67438587323 * X) And I get a Goodness of fit (R2) of 0.899797719361 for an exponential regression I know that it's definitely a power regression, which gives a Goodness of fit (R2) of 0.999654455365 Quote Link to comment Share on other sites More sharing options...
corbin Posted December 28, 2008 Share Posted December 28, 2008 I feel really stupid. But I'm confused... For example: 148.771289841 + (10^2.15106867905) = 290.373059 You're right, I've gone wrong again. Multiplication rather than addition for power values: Total EXP = 148.771289841 * Level^2.15106867905 If by power you mean exponential, that's not exponential. Exponential: f(x) = x^a +c, x != 1 x^a should have been a^x, a != 1 x.x. If by power you mean exponential, that's not exponential. No, I do mean a power regression. With a power regression, you apply the log to both the X and Y values before doing the least square fitting. For an exponential regression, you apply the log only to the Y values before doing the least square fitting. And the equation for an Exponential regression is Y = 70.2572663284 * e(2.67438587323 * X) And I get a Goodness of fit (R2) of 0.899797719361 for an exponential regression I know that it's definitely a power regression, which gives a Goodness of fit (R2) of 0.999654455365 Hrmm just never heard of a power function before. Guess it would be any function in which the highest power is greater 1 (or the absol value) and the base of that power is the value passed to the function. Edit: Guess power is like an "n-th" version of a quadratic, or cubic or whatever ;p. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 28, 2008 Share Posted December 28, 2008 Hrmm just never heard of a power function before. Guess it would be any function in which the highest power is greater 1 (or the absol value) and the base of that power is the value passed to the function. It's one of the standard trends available within MS Excel (Linear, Exponential, Logarithmic, Power, Rolling Average and Polynomial). Sometimes also known as Log-log regression. A useful reference is Least Squares Fitting - Power Law at Wolfram Mathworld, which is where I got most of the math for my own PHP implementation. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted December 28, 2008 Share Posted December 28, 2008 Just for luck (I've just got polynomial regression working), a 3rd Order polynomial regression gives a 100% fit.... remembering that this is derived from only 4 data points in the series. The coefficients are: -8.00886 9.68366166667 136.490825 11.8345233333 Giving Y = -8.00886 + 9.68366166667 * X + 136.490825 * X^2 + 11.8345233333 * X^3 EXP = -8.00886 + 9.68366166667 * Level + 136.490825 * Level^2 + 11.8345233333 * Level^3 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.