'What is the number of degrees needed for polynomial curve fitting?

Assume we have m data points.

  1. What is the number of degrees needed for polynomial curve fitting if we wish to make the adjusted R^2 value to be 1? (Theoretically, it will be 1, but realistically it's nearly 1 due to round off errors).

  2. What is the reason for the chosen number?

8 points (2 0 0 3 8 5 3 3 ) example shown below, but you have to answer with m data points. If you use 8 data points your score will be reduced.

example



Solution 1:[1]

A polynomial of degree m-1 will exactly fit (R^2 = 1) m data points with different x values.

A m-1 degree polynomial has m degrees of freedom a_i:

y(x) = a_1 + a_2 x^1 + a_3 x^2 + ... + a_m x^(m-1)

The m degrees of freedom of a m-1 degree polynomial allow it to uniquely fit to m data points.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user213305