# How do I find the best fit line which passes through a series of data? [closed]

I have a list of data and want to create a function which passes through them.

I'm new to Mathematica and don't know how to do this work.

Could anyone explain this topic with fitting the below data?

Here is a sample of my data.

{9.28188, 9.28188, 9.28188, 9.28188, 9.28188, 9.28188, 9.28391,
9.29315, 9.30736, 9.32627, 9.34909, 9.37394, 9.39704, 9.41008,
9.41007, 9.41007, 9.41007, 9.41007, 9.41007, 9.41007, 9.41007,
9.41007, 9.41007, 9.41007, 9.41007}

• I've given a good explanation here, but here is the gist: use fitting if your data have experimental error in them, and use interpolation if you are sure all those numbers are correct. – J. M.'s torpor Jul 30 '17 at 3:33
• blendFun[n_, nblend_, nexp_, offset_, gain_] := offset - gain ((nblend/n)^nexp - (n/nblend)^nexp)/((nblend/n)^ nexp + (n/nblend)^nexp); nlm = NonlinearModelFit[data, blendFun[n, nblend, nexp, offset, gain], {{nblend, 11}, {nexp, 5}, {offset, 9.41}, {gain, 0.13}}, n]; – Jack LaVigne Aug 19 '17 at 17:56
• @JackLaVigne, Thanks for your reply, but your response is very advanced! Is there any another simple procedure? I can't figure out the logic of your solution. May i find a continuous function instead of discontinuous one? – PhysicsExams Aug 19 '17 at 20:07
• @JackLaVigne I sent an e-mail with ID: ali.nematy@gmail.com. Thanks – PhysicsExams Aug 21 '17 at 8:34