I would like to fit a function to a set of data:
data = {
{8, 0.138177}, {16, 0.0789974},
{32, 0.0479225}, {64, 0.0351548},
{128, 0.0299134}, {1024, 0.0277813}}
I tried something like:
nlm =
NonlinearModelFit[
data,
{a + b Log[c x], c > 0},
{a, b, c}, x]
But I still can't get an ideal result. The plot looks like this:
Plot[nlm["BestFit"], {x, 0, 1024}, PlotRange -> {{0, 1030}, {0, 0.2}}, BaseStyle -> {FontFamily -> "Times", 16}, Frame -> True, FrameStyle -> Black, FrameLabel -> {{"Relative error", ""}, {"Time increments", ""}}, Epilog -> {{Red, PointSize[Large], Point@data}}]
Maybe I'm not using the correct fitting model here, so I got stuck for a while. Any help or suggestion will be appreciated!
Plot
of your result (curve and data superimposed) and describe what would constitute an ideal result. $\endgroup$Plot[ nlm["SinglePredictionBands"], {x,8,1024}, PlotRange->All]
. $\endgroup$a + b/x^c
. $\endgroup$