Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

This is a continuation of How to find curve equation from data? I asked earlier.

I am looking for both a formula and the method to find the best (integer) polynomial that fits my data. I still assume it will a quadratic equation.
The resulting formula will ideally be just integers, but they can float values with 2 decimals at maximum. Rounding rules can be: down, natural or up.
With the formula will I convert it to javascript, which is where it will be used.

Sample data:

X   Y
1   4
2   8
3   13
4   18
5   24
6   30
7   37
8   44
9   51
10  60
11  68
12  78
13  88
14  99
15  110
16  122
17  136
18  150
19  166
20  180
21  197
22  216
23  235
24  255
25  277
26  300
27  325
28  351
29  378
30  408
share|improve this question
    
"I still assume it will a quadratic equation." - that depends. Even if you do apply linear regression to this, it's not enough. At the very least, you should be checking the coefficient of determination ($R^2$) and see if it's "near enough" to $1$ for your needs... –  J. M. Mar 19 '12 at 13:57
    
I had no idea what the "coefficient of determination" was until you said it, but it is 0.9989 for the sample data and using all data (~50 points) is becomes 0.9949. Only the quartic formula found by W|A comes closest with 4 incorrect values when using natural rounding, but this is only for the sample data and applying it for the ~20 remaining points results in + ~20 incorrect values. So I am no closer to a solution. –  Kim Mar 21 '12 at 14:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.