-1

I am trying to fit a polynomial to the data listed as

{{0,6.67},{6,17.33},{10,42.67},{13,37.33},{17,30.1},{20,29.31},{28,28.74}}. 

When I use

LinearModelFit[data,{x,x^2,x^3,x^4,x^5,x^6},x]

I get

FittedModel[6.67-42.6435x+16.1427x^2-<<19>>x^3 +<<20>>x^4-0.00367168x^5 +0.0000409458x^6.

I don't understand why I am not getting any coefficients for the x^3 and x^4 terms that make sense and would like some assistance in solving this problem.

Rohit Namjoshi
  • 10,212
  • 6
  • 16
  • 67
user41071
  • 117
  • 4
  • 1
    When you have fm = LinearModelFit[…], then you can query the coefficients like this: fm["BestFitParameters"] – SHuisman Feb 25 '20 at 16:56

1 Answers1

0

Looks like a severe case of overfitting

lmf = LinearModelFit[data, {x, x^2, x^3, x^4, x^5, x^6}, x]
Show[{ListPlot@data, Plot[lmf[x], {x, 0, 30}]}, PlotRange -> All]

enter image description here

Rohit Namjoshi
  • 10,212
  • 6
  • 16
  • 67