-1
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ When you have fm = LinearModelFit[…], then you can query the coefficients like this: fm["BestFitParameters"] $\endgroup$ – SHuisman Feb 25 at 16:56
0
$\begingroup$

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

|improve this answer|||||
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.