# Curve fitting, Polynomial [closed]

I have a data set in such a manner

{x,y}= {
{10^-6,10^-15},
{10^-5,10^-14},
{10^-4,10^-14},
{10^-3,10^-13},
{10^-2,10^-11},
{10^-1,10^-9},
{1,10^-8}
}


I want to fit a polynomial for these data sets.

## closed as off-topic by JimB, Hector, Bob Hanlon, m_goldberg, Michael E2Jul 18 '18 at 3:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Hector, Bob Hanlon, m_goldberg, Michael E2
If this question can be reworded to fit the rules in the help center, please edit the question.

• see Interpolation and Fit – kglr Jul 17 '18 at 9:36
• I've voted to close because fitting polynomials is readily available in the documentation, there is essentially no effort, and a polynomial is not appropriate for the artificial data (although a log transformation for both variables would make a polynomial more appropriate). – JimB Jul 17 '18 at 15:44

xy = {{10^-6, 10^-15}, {10^-5, 10^-14}, {10^-4, 10^-14}, {10^-3,
10^-13}, {10^-2, 10^-11}, {10^-1, 10^-9}, {1, 10^-8}};


### Interpolation

ClearAll[intf]
intf = Interpolation[xy, InterpolationOrder -> 3];
Plot[intf[t], {t, 0, 1}]


### Fit

ClearAll[fitf]
fitf[x_] := Evaluate@Fit[xy, {1, x, x^2, x^3}, {x}]
Plot[fitf[x], {x, 0, 1}]


xy = {{10^-6, 10^-15}, {10^-5, 10^-14}, {10^-4, 10^-14},
{10^-3, 10^-13}, {10^-2, 10^-11}, {10^-1, 10^-9}, {1, 10^-8}};

{x, y} = Transpose[xy];

X = Transpose[{x^3, x^2, x^1, x^0}];

{a, b, c, d} = Inverse[Transpose[X].X].Transpose[X].y;

{from, to} = x[[{1, -1}]];

Show[ListPlot[xy, PlotMarkers -> {Automatic, Medium}],
Plot[a x^3 + b x^2 + c x + d, {x, from, to}],
PlotRange -> All]