Polynomial regression: Difference between revisions

m
(adding gap)
Line 508:
Note that this implementation does not use floating point numbers, so we do not introduce floating point errors. Using exact arithmetic has a speed penalty, but for small problems like this it is inconsequential.
 
The above solution fits a polynomial of order 11. If the order of the polynomial is known to be 3 (as is implied in the task description) then the following solution is probably preferable.
<lang j> Y (%. (i.3) ^/~ ]) X
1 2 3</lang>
6,962

edits