I have a data set of $10^4$ entries. I want to plot the last $2000$ data with the same argument at $x$ axis and fit a curve. That means the range of $x$ axis will be $8001$ to $10000$ incremented by $1$.
I wrote code like the following to know the coefficient of fitting curve:
d = Import["ss.dat"];
T = Table[d[[1, i]], {i, 8001, 10000}];
FindFit[T, a*E^(-b*x), {a, b}, x]
FindFit
returns the values of $a$ and $b$ considering $x$ to range from $1$ to $2000$ instead of $8001$ to $10000$.
If anyone can tell me how to deal with this problem that will be great help.
I am attaching data in the following link:
T = Table[{i, d[[1, i]]}, {i, 8001, 10000}];
. This will allow you to giveFindFit
2D data with the specific x values you want. $\endgroup$lmf = LinearModelFit[Transpose[{T[[All, 1]], Log[T[[All, 2]]]}], x, x] Show[LogPlot[Exp[lmf[x]], {x, 8001, 10000}, PlotStyle -> {LightGray, Thickness[0.03]}], ListLogPlot[T, PlotStyle -> Red]]
. $\endgroup$